Skip to content

Commit 7180dac

Browse files
Eduard Bosch BertranEduard Bosch Bertran
Eduard Bosch Bertran
authored and
Eduard Bosch Bertran
committed
feat: Convert $regex value to RegExp object
1 parent 1832f54 commit 7180dac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ const transformInteriorAtom = atom => {
445445
return DateCoder.JSONToDatabase(atom);
446446
} else if (BytesCoder.isValidJSON(atom)) {
447447
return BytesCoder.JSONToDatabase(atom);
448+
} else if (typeof atom === 'object' && atom && atom.$regex !== undefined) {
449+
return new RegExp(atom.$regex);
448450
} else {
449451
return atom;
450452
}

0 commit comments

Comments
 (0)