This commit is contained in:
Erik 2022-07-07 11:21:47 +03:00
parent ffb57d6e78
commit 7420d565e1
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -170,8 +170,7 @@ class MongodbTable {
}
_handleData(data) { //Convert data._id to Mongo ObjectIds
console.log(data);
if (data._id) {
if (data._id && !(data._id instanceof ObjectId)) {
if (typeof data._id === 'string') data._id = ObjectId(data._id);
else if (typeof data._id === 'object') data._id = {
$in: Object.values(data._id)[0].map((id) => {