dobo 1.2.8 → 1.2.10
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/index.js +1 -0
- package/lib/multi-rel-rows.js +1 -1
- package/package.json +1 -1
- package/plugin-method/record/find-all.js +9 -1
package/index.js
CHANGED
package/lib/multi-rel-rows.js
CHANGED
|
@@ -30,7 +30,7 @@ async function multiRelRows ({ schema, records, options = {} }) {
|
|
|
30
30
|
for (const i in records) {
|
|
31
31
|
records[i]._rel = records[i]._rel ?? {}
|
|
32
32
|
const rec = records[i]
|
|
33
|
-
const res = results.find(r => (r[val.propName] + '') === rec[prop.name])
|
|
33
|
+
const res = results.find(r => (r[val.propName] + '') === rec[prop.name] + '')
|
|
34
34
|
if (res) records[i]._rel[key] = await this.pickRecord({ record: res, fields, schema: relschema })
|
|
35
35
|
else records[i]._rel[key] = {}
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
async function findAll (name, filter = {}, options = {}) {
|
|
2
|
+
const { maxLimit, hardLimit } = this.config.default.filter
|
|
2
3
|
filter.page = 1
|
|
3
|
-
filter.limit =
|
|
4
|
+
filter.limit = maxLimit
|
|
4
5
|
options.dataOnly = true
|
|
5
6
|
const match = filter.match
|
|
6
7
|
const all = []
|
|
8
|
+
let count = 0
|
|
7
9
|
for (;;) {
|
|
8
10
|
filter.match = match
|
|
9
11
|
const results = await this.recordFind(name, filter, options)
|
|
10
12
|
if (results.length === 0) break
|
|
13
|
+
if (count + results.length > hardLimit) {
|
|
14
|
+
const sliced = results.slice(0, hardLimit - count)
|
|
15
|
+
all.push(...sliced)
|
|
16
|
+
break
|
|
17
|
+
}
|
|
11
18
|
all.push(...results)
|
|
19
|
+
count = count + results.length
|
|
12
20
|
filter.page++
|
|
13
21
|
}
|
|
14
22
|
return all
|