Mongoose find by ObjectID reference Mongoose find by ObjectID reference mongoose mongoose

Mongoose find by ObjectID reference


You can request a town by name and use the mongoose populate method to fill the ads Array from town object.

You can find examples in the mongoose documentation:

http://mongoosejs.com/docs/populate.html