waibu-db 1.1.16 → 1.1.17
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/lib/prep-crud.js
CHANGED
|
@@ -2,7 +2,7 @@ function prepCrud ({ model, body, id, req, reply, options = {}, args }) {
|
|
|
2
2
|
const { parseFilter } = this.app.waibu
|
|
3
3
|
const { pascalCase } = this.app.bajo
|
|
4
4
|
const { cloneDeep, has } = this.lib._
|
|
5
|
-
const cfgWeb = this.app.waibu.
|
|
5
|
+
const cfgWeb = this.app.waibu.getConfig()
|
|
6
6
|
const opts = cloneDeep(options)
|
|
7
7
|
const params = this.getParams(req, ...args)
|
|
8
8
|
for (const k of ['count', 'fields']) {
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ async function aggregate ({ model, req, reply, options = {} }) {
|
|
|
7
7
|
for (const item of ['group', 'aggregate']) {
|
|
8
8
|
opts[item] = options[item] ?? req.params[item] ?? req.query[item]
|
|
9
9
|
}
|
|
10
|
+
opts.aggregate = opts.aggregate ?? 'count'
|
|
10
11
|
return await statAggregate(name, parseFilter(req), opts)
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -7,6 +7,7 @@ async function histogram ({ model, req, reply, options = {} }) {
|
|
|
7
7
|
for (const item of ['type', 'group', 'aggregate']) {
|
|
8
8
|
opts[item] = options[item] ?? req.params[item] ?? req.query[item]
|
|
9
9
|
}
|
|
10
|
+
opts.aggregate = opts.aggregate ?? 'count'
|
|
10
11
|
return await statHistogram(name, parseFilter(req), opts)
|
|
11
12
|
}
|
|
12
13
|
|