Skip to content

Commit 27409e3

Browse files
committed
$regex op value hanlding
When using $regex op, the value type isn't a string. It is a regex object, which means that we need to exrtact the source. Signed-off-by: Evgeniy Belyi <jeniawhite92@gmail.com>
1 parent b8f857c commit 27409e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function convertOp(path, op, value, parent, arrayPaths) {
120120
if (!parent['$options'] || !parent['$options'].includes('s')) {
121121
op2 += '(?p)'
122122
}
123-
return util.pathToText(path, true) + ' ' + op + ' \'' + op2 + util.stringEscape(value) + '\''
123+
return util.pathToText(path, true) + ' ' + op + ' \'' + op2 + util.stringEscape(value.source) + '\''
124124
case '$eq':
125125
case '$gt':
126126
case '$gte':

0 commit comments

Comments
 (0)