get collection mongoose code example
Example 1: connect to existing collection mongoose
new Schema({ url: String, text: String, id: Number},
{ collection : 'question' }); // collection name
Example 2: callback mongoose get value from document
var query = Model.find({});
query.where('field', 5);
query.limit(5);
query.skip(100);
query.exec(function (err, docs) {
// called when the `query.complete` or `query.error` are called
// internally
});