dobo 2.30.1 → 2.30.3
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.
|
@@ -122,20 +122,22 @@ async function memoryDriverFactory () {
|
|
|
122
122
|
const { data: count = 0 } = await this.countRecord(model, filter, options)
|
|
123
123
|
const cursor = this._getCursor(model, filter)
|
|
124
124
|
if (sort) cursor.sort(sort)
|
|
125
|
-
|
|
125
|
+
cursor.skip(skip).limit(limit)
|
|
126
126
|
let result = { data: cursor.all(), page, limit, count, pages: Math.ceil(count / limit) }
|
|
127
127
|
if (!options.count) result = omit(result, ['count', 'pages'])
|
|
128
128
|
return result
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
async findAllRecord (model, filter = {}, options = {}) {
|
|
132
|
+
const { hardCap } = this.app.dobo.getDefaultValues(options)
|
|
133
|
+
filter.limit = hardCap
|
|
134
|
+
delete filter.skip
|
|
135
|
+
delete filter.page
|
|
132
136
|
const { sort } = filter
|
|
133
|
-
const { data: count = 0 } = await this.countRecord(model, filter, options)
|
|
134
137
|
const cursor = this._getCursor(model, filter)
|
|
138
|
+
cursor.limit(filter.limit)
|
|
135
139
|
if (sort) cursor.sort(sort)
|
|
136
|
-
|
|
137
|
-
if (!options.count) result = omit(result, ['count'])
|
|
138
|
-
return result
|
|
140
|
+
return { data: cursor.all(), hardCapped: true }
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
async countRecord (model, filter = {}, options = {}) {
|
package/lib/collect-models.js
CHANGED
|
@@ -353,9 +353,9 @@ async function collectModels () {
|
|
|
353
353
|
const prop = schema.properties.find(p => p.name === field)
|
|
354
354
|
if (!prop || (prop && prop.virtual)) throw this.error('virtualFieldIn%s%s%s', field, 'scanable', schema.name)
|
|
355
355
|
}
|
|
356
|
-
if (schema.buildEnd) await callHandler(plugin, schema.buildEnd, schema)
|
|
357
356
|
const model = new this.app.baseClass.DoboModel(plugin, omit(schema, ['beforeCreate', 'afterCreate']))
|
|
358
357
|
me.models.push(model)
|
|
358
|
+
if (schema.buildEnd) await callHandler(plugin, schema.buildEnd, model)
|
|
359
359
|
}
|
|
360
360
|
schemas = []
|
|
361
361
|
this.log.debug('collected%s%d', this.t('model'), this.models.length)
|
|
@@ -10,6 +10,9 @@ async function native (...args) {
|
|
|
10
10
|
opts.dataOnly = opts.dataOnly ?? true
|
|
11
11
|
const { dataOnly } = opts
|
|
12
12
|
const { filter, options } = await getFilterAndOptions.call(this, params, opts, action)
|
|
13
|
+
delete filter.limit
|
|
14
|
+
delete filter.page
|
|
15
|
+
delete filter.skip
|
|
13
16
|
const { hardCap, warnings } = getDefaultValues(options)
|
|
14
17
|
if (dataOnly) options.count = false
|
|
15
18
|
const { noResultSanitizer } = options
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-06-13
|
|
4
|
+
|
|
5
|
+
- [2.30.2] Bug fix in ```model.findAllRecord()```
|
|
6
|
+
- [2.30.2] Bug fix in ```memory.findAllRecord()```
|
|
7
|
+
- [2.30.2] Bug fix in ```collect-models.js```
|
|
8
|
+
- [2.30.3] Bug fix in ```memory.findRecord()```
|
|
9
|
+
|
|
3
10
|
## 2026-06-12
|
|
4
11
|
|
|
5
12
|
- [2.30.0] Necessary updates to ```bajo@2.18.0``` specs
|