.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);
req
)