Use schema collection instead of adaptive collection for all schema operations.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user