1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00
This commit is contained in:
Mel O'Hagan 2022-08-23 15:33:30 +01:00
parent da4107b26c
commit e0744000a4

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]