Przeglądaj źródła

add addConditionToExistPaths

takeru0001 5 lat temu
rodzic
commit
b4a966c71a
1 zmienionych plików z 11 dodań i 0 usunięć
  1. 11 0
      src/server/models/page.js

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

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