@mongez/mongodb
Advanced tools
Comparing version 1.0.65 to 1.0.66
@@ -35,3 +35,3 @@ "use strict"; | ||
.get(); | ||
return records | ||
const documents = records | ||
.map((record) => { | ||
@@ -41,2 +41,11 @@ return getModelData(record, embeddedKey); | ||
.filter((value) => !Is__default.default.empty(value)); | ||
// now we need to order documents same as the value | ||
const orderedDocuments = []; | ||
for (const item of value) { | ||
const document = documents.find((document) => document.id === item.id); | ||
if (document) { | ||
orderedDocuments.push(document); | ||
} | ||
} | ||
return orderedDocuments; | ||
} | ||
@@ -43,0 +52,0 @@ if (value instanceof model.Model) return getModelData(value, embeddedKey); |
@@ -29,3 +29,3 @@ import Is from "@mongez/supportive-is"; | ||
.get(); | ||
return records | ||
const documents = records | ||
.map((record) => { | ||
@@ -35,2 +35,11 @@ return getModelData(record, embeddedKey); | ||
.filter((value) => !Is.empty(value)); | ||
// now we need to order documents same as the value | ||
const orderedDocuments = []; | ||
for (const item of value) { | ||
const document = documents.find((document) => document.id === item.id); | ||
if (document) { | ||
orderedDocuments.push(document); | ||
} | ||
} | ||
return orderedDocuments; | ||
} | ||
@@ -37,0 +46,0 @@ if (value instanceof Model) return getModelData(value, embeddedKey); |
{ | ||
"name": "@mongez/mongodb", | ||
"version": "1.0.65", | ||
"version": "1.0.66", | ||
"description": "Powerful Mongodb Database Manager for Node Js", | ||
@@ -30,5 +30,5 @@ "main": "./cjs/index.js", | ||
"console-table-printer": "^2.11.1", | ||
"commander": "^10.0.1", | ||
"commander": "^11.0.0", | ||
"chalk": "^4", | ||
"eslint": "^8.42.0", | ||
"eslint": "^8.43.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
@@ -35,0 +35,0 @@ "eslint-plugin-prettier": "^4.2.1", |
381679
14357