Skip to content

Commit 43a093f

Browse files
committedSep 8, 2022
Clean up and version update to v1.7.1.
1 parent 1b4725f commit 43a093f

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.7.1
4+
5+
- Added support for custom find method.
6+
37
## v1.7.0
48

59
[2022-07-04]

‎README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Returns promise
7979

8080
- `[query]` {Object} - Query criteria. [Documentation](https://docs.mongodb.org/manual/tutorial/query-documents)
8181
- `[options]` {Object}
82+
8283
- `[select]` {Object | String} - Fields to return (by default returns all fields). [Documentation](http://mongoosejs.com/docs/api.html#query_Query-select)
8384
- `[collation]` {Object} - Specify the collation [Documentation](https://docs.mongodb.com/manual/reference/collation/)
8485
- `[sort]` {Object | String} - Sort order. [Documentation](http://mongoosejs.com/docs/api.html#query_Query-sort)
@@ -90,16 +91,17 @@ Returns promise
9091
- `[page=1]` {Number}
9192
- `[limit=10]` {Number}
9293
- `[customLabels]` {Object} - Developers can provide custom labels for manipulating the response data.
93-
- `[pagination]` {Boolean} - If `pagination` is set to false, it will return all docs without adding limit condition. (Default: True)
94-
- `[useEstimatedCount]` {Boolean} - Enable [estimatedDocumentCount](https://docs.mongodb.com/manual/reference/method/db.collection.estimatedDocumentCount/) for larger datasets. Does not count based on given query, so the count will match entire collection size. (Default: False)
95-
- `[useCustomCountFn]` {Boolean} - Enable custom function for count datasets. (Default: False)
96-
- `[forceCountFn]` {Boolean} - Set this to true, if you need to support \$geo queries. (Default: False)
97-
- `[allowDiskUse]` {Boolean} - Set this to true, which allows the MongoDB server to use more than 100 MB for query. This option can let you work around QueryExceededMemoryLimitNoDiskUseAllowed errors from the MongoDB server. (Default: False)
94+
- `[pagination]` {Boolean} - If `pagination` is set to false, it will return all docs without adding limit condition. (Default: `True`)
95+
- `[useEstimatedCount]` {Boolean} - Enable [estimatedDocumentCount](https://docs.mongodb.com/manual/reference/method/db.collection.estimatedDocumentCount/) for larger datasets. Does not count based on given query, so the count will match entire collection size. (Default: `False`)
96+
- `[useCustomCountFn]` {Boolean} - Enable custom function for count datasets. (Default: `False`)
97+
- `[forceCountFn]` {Boolean} - Set this to true, if you need to support \$geo queries. (Default: `False`)
98+
- `[customFind]` {String} - Method name for the find method which called from Model object. This options can be used to change default behaviour for pagination in case of different use cases (like [mongoose-soft-delete](https://github.com/dsanel/mongoose-delete#method-overridden)). (Default `'find'`)
99+
- `[allowDiskUse]` {Boolean} - Set this to true, which allows the MongoDB server to use more than 100 MB for query. This option can let you work around QueryExceededMemoryLimitNoDiskUseAllowed errors from the MongoDB server. (Default: `False`)
98100
- `[read]` {Object} - Determines the MongoDB nodes from which to read. Below are the available options.
99101
- `[pref]`: One of the listed preference options or aliases.
100102
- `[tags]`: Optional tags for this query. (Must be used with `[pref]`)
101103
- `[options]` {Object} - Options passed to Mongoose's `find()` function. [Documentation](https://mongoosejs.com/docs/api.html#query_Query-setOptions)
102-
- `[customFind]` {String} - Method name for the find method which called from Model object. This options can be used to change default behaviour for pagination in case of different use cases (like [mongoose-soft-delete](https://github.com/dsanel/mongoose-delete#method-overridden)). (Default `'find'`)
104+
103105
- `[callback(err, result)]` - If specified, the callback is called once pagination results are retrieved or when an error has occurred
104106

105107
**Return value**
@@ -404,9 +406,9 @@ Model.paginate({}, options, function (err, result) {
404406

405407
Below are some references to understand more about preferences,
406408

407-
- https://github.com/Automattic/mongoose/blob/master/lib/query.js#L1008
408-
- https://docs.mongodb.com/manual/core/read-preference/
409-
- http://mongodb.github.io/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences
409+
- <https://github.com/Automattic/mongoose/blob/master/lib/query.js#L1008>
410+
- <https://docs.mongodb.com/manual/core/read-preference/>
411+
- <http://mongodb.github.io/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences>
410412

411413
## Known Issues
412414

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongoose-paginate-v2",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"description": "A custom pagination library for Mongoose with customizable labels.",
55
"main": "dist/index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)
Please sign in to comment.