mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 13:46:34 +02:00
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (module) {
|
||||
const helpers = require('./helpers');
|
||||
const dbHelpers = require('../helpers');
|
||||
module.flushdb = async function () {
|
||||
await module.client.dropDatabase();
|
||||
};
|
||||
@@ -39,7 +39,7 @@ module.exports = function (module) {
|
||||
};
|
||||
|
||||
module.scan = async function (params) {
|
||||
const match = helpers.buildMatchQuery(params.match);
|
||||
const match = dbHelpers.globToRegex(params.match);
|
||||
return await module.client.collection('objects').distinct(
|
||||
'_key', { _key: { $regex: new RegExp(match) } }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user