diff --git a/src/utils.js b/src/utils.js index 523600a..8f68561 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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)) {