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

@@ -21,7 +21,9 @@ const mongoIdRegex = /^[0-9a-f]{24}$/;
function convertConditionInternal(condition) {
if (condition && _.isString(condition._id) && condition._id.match(mongoIdRegex)) {
return {
_id: ObjectId(condition._id),
_id: {
$in: [condition._id, ObjectId(condition._id)],
},
};
}
return condition;