dobo 2.26.1 → 2.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extend/dobo/driver/memory.js +0 -6
- package/lib/factory/driver.js +1 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +1 -0
|
@@ -129,12 +129,6 @@ async function memoryDriverFactory () {
|
|
|
129
129
|
return result
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
async findOneRecord (model, filter = {}, options = {}) {
|
|
133
|
-
filter.limit = 1
|
|
134
|
-
const result = await this.findRecord(model, filter, options)
|
|
135
|
-
return { data: result.data[0] }
|
|
136
|
-
}
|
|
137
|
-
|
|
138
132
|
async findAllRecord (model, filter = {}, options = {}) {
|
|
139
133
|
const { sort } = filter
|
|
140
134
|
const { data: count = 0 } = await this.countRecord(model, filter, options)
|
package/lib/factory/driver.js
CHANGED
|
@@ -150,7 +150,7 @@ async function driverFactory () {
|
|
|
150
150
|
if (isSet(body[field])) query[field] = body[field]
|
|
151
151
|
}
|
|
152
152
|
if (isEmpty(query)) continue
|
|
153
|
-
const data = await
|
|
153
|
+
const { data } = await model.findOneRecord({ query }, options)
|
|
154
154
|
if (!isEmpty(data)) {
|
|
155
155
|
if (['updateRecord', 'upsertRecord'].includes(options.action)) {
|
|
156
156
|
let eq = true
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED