Thursday, August 1, 2013

How to fire an embedded document in another document in MongoDB / Mongoose.js

Here's what I had to do:

socket.on('get:planet', function (data, callback) {

//console.log('get planet heard');

planetModel

                .find({_id:data.planetId})

                .populate('consortium')

                .exec(function (err, results) {

callback();

socket.emit('send:planet', {

planet:results[0]

});

});

});

Populate pulls the goods from another record and plops it in there.

But now my problem is how to use Angular select ngOptions to deal with this in a form?

No comments:

Post a Comment