.manager
此資料儲存區的即時連線管理器。
datastore.manager
根據不同的适配器,這可能代表連線池、單一連線,或僅僅是對預先設定的用戶端函式庫實例的參考。
存取代表 Pet
模型的原始 Mongo 集合實例。
// Since the db connection manager exposed by `sails-mongo` is actually
// the same as the Mongo client's `db` instance, we can treat it as such.
var db = Pet.getDatastore().manager;
// Now we can do anything we could do with a Mongo `db` instance:
var rawMongoCollection = db.collection(Pet.tableName);