scan. glob to regex (#14063)

* scan. glob to regex

* lint
This commit is contained in:
Barış Uşaklı
2026-03-05 16:01:03 -05:00
committed by GitHub
parent 5d1a8a11fd
commit 7d50baecf0
6 changed files with 44 additions and 30 deletions

View File

@@ -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) } }
);