feat(pagination): Adds MVP pagination to orders and products for admin routes
This commit is contained in:
@@ -67,8 +67,16 @@ class BaseModel {
|
||||
* @return {Array<mongoose.Document>} the retreived mongoose documents or
|
||||
* an empty array
|
||||
*/
|
||||
find(query, options) {
|
||||
return this.mongooseModel_.find(query, options).lean()
|
||||
find(query, options, offset, limit) {
|
||||
return this.mongooseModel_
|
||||
.find(query, options)
|
||||
.skip(offset)
|
||||
.limit(limit)
|
||||
.lean()
|
||||
}
|
||||
|
||||
count() {
|
||||
return this.mongooseModel_.count({})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user