Skip to content

Commit

Permalink
Fix broken Regex
Browse files Browse the repository at this point in the history
  • Loading branch information
globules-io committed Apr 5, 2024
1 parent eb8ea94 commit bdd8957
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions collection.mongogx.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,13 @@ OGX.MongogxCollection = class{
So, no more eval here, just build path, if you meet array, this is the choice, then stop.
If there is shit after any, stop and return that multi nesting find is to do
If not supported by mongo (it does't seem to be), then let's not do it (doable but slow, recursions of x arrays)
*/

*/
//if direct prop/val pair, convert to eq
if(typeof(__query[prop]) !== 'object'){
var f = {};
f = {eq:__query[prop]};
f = {$eq:__query[prop]};
__query[prop] = f;
}
}

base = data[_id];
path = prop.split('.');
Expand Down Expand Up @@ -307,8 +306,8 @@ OGX.MongogxCollection = class{
}
break;

case 'regex':
match = (__value[op].match(__obj_value));
case 'regex':
match = __obj_value.match(__value[op]);
break;

case 'mod':
Expand Down

0 comments on commit bdd8957

Please sign in to comment.