Is it possible to set what field should be the "id" field? I'm defining my scheme with:
var Person = app.ormDb.define('person', {
id : { type: String, index: true, default: function () { return uuid.v4(); } },
oAuthID : { type: String, index: true },
name : { type: String },
gender : { type: String },
birth : { type: Date },
email : { type: String },
imageID : { type: String },
favorites : { type: JSON, default: function() { return {cars : [], animals : []}; } },
date : { type: Date, default: function() { return new Date(); } },
updated : { type: Date, default: function() { return new Date(); } }
});
and my defined id
field shows up in MongoDB but when I use jugglingdb to lookup a person the returned value for Person.id is the MongoDB _id ObjectId value. so my id
is hidden.