fixed mongo update condition

This commit is contained in:
Jan Prochazka
2021-12-02 14:15:07 +01:00
parent 2649a0174d
commit 8a13d88c3e
4 changed files with 21 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ const mongoIdRegex = /^[0-9a-f]{24}$/;
function getConditionPreview(condition) {
if (condition && _isString(condition._id) && condition._id.match(mongoIdRegex)) {
return `{ _id: ObjectId('${condition._id}') }`;
return `{ _id: { $in: ['${condition._id}', ObjectId('${condition._id}')] } }`;
}
return JSON.stringify(condition);
}