var EventRelation, db, mongoose; mongoose = require('mongoose'); db = mongoose.connect('mongodb://localhost/db_name', function(err) { if (err) { console.log(err); } else { console.log('Connection Success!'); } } ); DBSchema = new mongoose.Schema({ id : Number, update_time : Date }); exports.testDB = db.model('lower case of collection_name+s', DBSchema);
- Uncategorized
- 261 view
[mongoose][mongoDB]How to select collection
![](https://zuqqhi2.com/wp-content/uploads/2013/08/20150322_mongodb1.jpg)
Select collection at “lower case of collection_name+s” part below.
Note that you have to add “s” at last end use lower case of collection name.