ryuichi-e 5 лет назад
Родитель
Сommit
076a8af3d6
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      src/server/models/bookmark.js

+ 2 - 0
src/server/models/bookmark.js

@@ -2,6 +2,7 @@
 
 const debug = require('debug')('growi:models:bookmark');
 const mongoose = require('mongoose');
+const mongoosePaginate = require('mongoose-paginate-v2');
 const uniqueValidator = require('mongoose-unique-validator');
 
 const ObjectId = mongoose.Schema.Types.ObjectId;
@@ -18,6 +19,7 @@ module.exports = function(crowi) {
     createdAt: { type: Date, default: Date.now },
   });
   bookmarkSchema.index({ page: 1, user: 1 }, { unique: true });
+  bookmarkSchema.plugin(mongoosePaginate);
   bookmarkSchema.plugin(uniqueValidator);
 
   bookmarkSchema.statics.countByPageId = async function(pageId) {