hi:
I have a MongoDB object schema defined as follows:
module.exports = mongoose.model('Thingy', {
user_id : String,
thing_stuff: String
});
During a request, I'd like to grab the user and associate this thing with him:
var user = req.user;
var thing = new Thingy({
user_id : user._id,
thing_stuff: "whatever"
});
Is this the proper way to store a reference to another mongodb document?