This commit is contained in:
Mel O'Hagan 2022-08-23 15:33:30 +01:00
parent bbc40b2d2c
commit 1e9234da8e
1 changed files with 4 additions and 2 deletions

View File

@ -92,8 +92,10 @@ module MongoDBModule {
if (json[field] instanceof Object) {
json[field] = self.createObjectIds(json[field])
}
if (typeof json[field] === "string" && json[field].toLowerCase().startsWith("objectid"))
{
if (
typeof json[field] === "string" &&
json[field].toLowerCase().startsWith("objectid")
) {
const id = json[field].match(
/(?<=objectid\(['"]).*(?=['"]\))/gi
)?.[0]