All tests passing

This commit is contained in:
Sebastian Rindom
2020-07-15 17:47:43 +02:00
parent 312e405588
commit ec6a538877
32 changed files with 226 additions and 304 deletions
+3 -3
View File
@@ -57,7 +57,7 @@ class BaseModel {
* @return {?mongoose.Document} the retreived mongoose document or null.
*/
findOne(query, options = {}) {
return this.mongooseModel_.findOne(query, options)
return this.mongooseModel_.findOne(query, options).lean()
}
/**
@@ -68,7 +68,7 @@ class BaseModel {
* an empty array
*/
find(query, options) {
return this.mongooseModel_.find(query, options)
return this.mongooseModel_.find(query, options).lean()
}
/**
@@ -80,7 +80,7 @@ class BaseModel {
*/
updateOne(query, update, options = {}) {
options.new = true
return this.mongooseModel_.findOneAndUpdate(query, update, options)
return this.mongooseModel_.findOneAndUpdate(query, update, options).lean()
}
/**