File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1+ ![ Banner] ( static/banner.jpg )
2+
13# mongoose-aggregate-paginate-v2
24
35[ ![ npm version] ( https://img.shields.io/npm/v/mongoose-aggregate-paginate-v2.svg )] ( https://www.npmjs.com/package/mongoose-aggregate-paginate-v2 )
@@ -269,23 +271,23 @@ This allows you to paginate the result at a given placeholder stage in a pipelin
269271const pipeline = [
270272 {
271273 $match: {
272- status: " active"
273- }
274+ status: " active" ,
275+ },
274276 },
275277 {
276278 $sort: {
277- date: - 1
278- }
279+ date: - 1 ,
280+ },
279281 },
280282 " __PREPAGINATE__" ,
281283 {
282284 $lookup: {
283285 from: " authors" ,
284286 localField: " author" ,
285287 foreignField: " _id" ,
286- as: " author"
287- }
288- }
288+ as: " author" ,
289+ },
290+ },
289291];
290292Model .aggregatePaginate (pipeline, options)
291293 .then (function (result ) {
You can’t perform that action at this time.
0 commit comments