Updated expandObjectIds function in utils.js to convert _id values to strings, ensuring consistent data formatting for object IDs.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit is contained in:
parent
e112ec4386
commit
e5981ce419
@ -1059,7 +1059,7 @@ function expandObjectIds(input) {
|
||||
for (const [key, val] of Object.entries(value)) {
|
||||
if (key === '_id') {
|
||||
// Do not expand keys that are already named _id
|
||||
result[key] = val;
|
||||
result[key] = val.toString();
|
||||
} else if (isObjectId(val)) {
|
||||
result[key] = { _id: val };
|
||||
} else if (Array.isArray(val)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user