@startup-booster/move-server-raven
Advanced tools
Comparing version 0.1.38 to 0.1.39
@@ -11,3 +11,3 @@ const { registerRpc } = require('../rpcUtils'); | ||
) => { | ||
registerRpc(socket, 'query', async (query, aggregate) => { | ||
registerRpc(socket, 'query', async (query, options = {}) => { | ||
const authorized = await authorize?.(socket.data.user, 'query', query); | ||
@@ -19,4 +19,10 @@ if (authorize && !authorized) { | ||
const session = store.openSession(); | ||
const q = session.advanced.rawQuery(query); | ||
if (aggregate) { | ||
let q = session.advanced.rawQuery(query); | ||
if (options.take) { | ||
q = q.take(options.take); | ||
} | ||
if (options.skip) { | ||
q = q.skip(options.skip); | ||
} | ||
if (options.aggregate) { | ||
return q.executeAggregation(); | ||
@@ -23,0 +29,0 @@ } |
{ | ||
"name": "@startup-booster/move-server-raven", | ||
"version": "0.1.38", | ||
"version": "0.1.39", | ||
"main": "server.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17590
526