Skip to content

Commit bdd8957

Browse files
committed
Fix broken Regex
1 parent eb8ea94 commit bdd8957

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

collection.mongogx.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,13 @@ OGX.MongogxCollection = class{
145145
So, no more eval here, just build path, if you meet array, this is the choice, then stop.
146146
If there is shit after any, stop and return that multi nesting find is to do
147147
If not supported by mongo (it does't seem to be), then let's not do it (doable but slow, recursions of x arrays)
148-
*/
149-
148+
*/
150149
//if direct prop/val pair, convert to eq
151150
if(typeof(__query[prop]) !== 'object'){
152151
var f = {};
153-
f = {eq:__query[prop]};
152+
f = {$eq:__query[prop]};
154153
__query[prop] = f;
155-
}
154+
}
156155

157156
base = data[_id];
158157
path = prop.split('.');
@@ -307,8 +306,8 @@ OGX.MongogxCollection = class{
307306
}
308307
break;
309308

310-
case 'regex':
311-
match = (__value[op].match(__obj_value));
309+
case 'regex':
310+
match = __obj_value.match(__value[op]);
312311
break;
313312

314313
case 'mod':

0 commit comments

Comments
 (0)