Use schema collection instead of adaptive collection for all schema operations.

This commit is contained in:
Nikita Lutsenko
2016-03-09 15:21:29 -08:00
parent 2730398b92
commit d86f0a8c69
4 changed files with 19 additions and 32 deletions

View File

@@ -76,17 +76,6 @@ export default class MongoCollection {
return this._mongoCollection.updateMany(query, update);
}
// Atomically find and delete an object based on query.
// The result is the promise with an object that was in the database before deleting.
// Postgres Note: Translates directly to `DELETE * FROM ... RETURNING *`, which will return data after delete is done.
findOneAndDelete(query) {
// arguments: query, sort
return this._mongoCollection.findAndRemove(query, []).then(document => {
// Value is the object where mongo returns multiple fields.
return document.value;
});
}
deleteOne(query) {
return this._mongoCollection.deleteOne(query);
}