These are chat archives for Automattic/mongoose

6th
Sep 2016
Peter B Smith
@peterbsmith2
Sep 06 2016 17:12
{
        "date": {
            "$date": 1393804800000
        },
        "grade": "A",
        "score": 2
}
What would the schema for this object look like in mongoose?
Pierre Humberdroz
@phumberdroz
Sep 06 2016 18:11
const postSchema = new Schema({
score: { type: ’number', required: true },
grade: { type: 'String', required: true },
date: { type: 'Date', default: Date.now, required: true },
});
Joël Poulin
@poulinjoel
Sep 06 2016 18:55
Hi there. Please, I need help. I need to make setup() and teardown() functions for testing MongoDB content. I already have a script that is filling up the db. In the teardown function, I would like to clear it all. I'm open to any suggestions and if someone used mocha-mongoose before and it worked, would be nice to use it.
Peter B Smith
@peterbsmith2
Sep 06 2016 19:17
@phumberdroz thanks!
Peter B Smith
@peterbsmith2
Sep 06 2016 21:48
Any thoughts on how to query an array at a specific index?
given {address: { coords: [-55, 23] } } how would someone determine if coords[0] === -55 ?
John
@johnfrades
Sep 06 2016 22:25
anyone here knows about mongodb aggregation?