Преглед изворни кода

add addConditionToExistPaths

takeru0001 пре 5 година
родитељ
комит
b4a966c71a
1 измењених фајлова са 11 додато и 0 уклоњено
  1. 11 0
      src/server/models/page.js

+ 11 - 0
src/server/models/page.js

@@ -258,6 +258,17 @@ class PageQueryBuilder {
     return this;
     return this;
   }
   }
 
 
+  addConditionToArrayExistPaths(paths) {
+    this.query = this.query
+      .and({
+        path: {
+          $in: paths,
+        },
+      });
+
+    return this;
+  }
+
   populateDataToList(userPublicFields) {
   populateDataToList(userPublicFields) {
     this.query = this.query
     this.query = this.query
       .populate({
       .populate({