schema Mongoose - array + object

20 views
Skip to first unread message

Olivier Bouth

unread,
Jan 26, 2014, 6:16:44 PM1/26/14
to mongoo...@googlegroups.com
Hello,
I want to represent this with mongoose schema, but I don't know how to do it :



var array = [];

array [_id] = {
    date
: Date,
    name : String,
    x
: Boolean,
    y
: Number
};


The objective is to get object with the key _id. This is more efficient for search an object.

For the moment, I have that :

Array = new mongoose.Schema([{
    _id : Number
    date: Date,
    name : String,
    x : Number,
    y : Number
}]}



Reply all
Reply to author
Forward
0 new messages