1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +12:00
This commit is contained in:
Mel O'Hagan 2022-07-26 11:38:34 +01:00
parent 377aca0458
commit 0ead7fca54

View file

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