Skip to content

Commit

Permalink
Handle regex as string or regex
Browse files Browse the repository at this point in the history
  • Loading branch information
globules-io committed Apr 5, 2024
1 parent bdd8957 commit 0924040
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion collection.mongogx.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ OGX.MongogxCollection = class{
}
break;

case 'regex':
case 'regex':
if(typeof __value[op] === 'string'){
__value[op] = new RegExp( __value[op] );
}
match = __obj_value.match(__value[op]);
break;

Expand Down

0 comments on commit 0924040

Please sign in to comment.