Skip to content

Commit 17569c5

Browse files
authored
Merge pull request #141 from mongoosejs/vkarpov15/mquery-v6
v6
2 parents e7a8a30 + fe47b50 commit 17569c5

File tree

7 files changed

+354
-197
lines changed

7 files changed

+354
-197
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ permissions:
88
jobs:
99
test:
1010
# os is not in the matrix, because otherwise there would be way too many testing instances
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
node: [14, 16, 18]
16-
mongo: [4.2, 5.0]
15+
node: ['20', '22', '24']
16+
mongo: [7.0, 8.0]
1717
services:
1818
mongodb:
1919
image: mongo:${{ matrix.mongo }}

lib/collection/collection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ const methods = [
1010
'updateMany',
1111
'updateOne',
1212
'replaceOne',
13-
'count',
13+
'countDocuments',
14+
'estimatedDocumentCount',
1415
'distinct',
1516
'findOneAndDelete',
17+
'findOneAndReplace',
1618
'findOneAndUpdate',
1719
'aggregate',
1820
'findCursor',

lib/collection/node.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ class NodeCollection extends Collection {
3131
}
3232

3333
/**
34-
* count(match, options)
34+
* countDocuments(match, options)
3535
*/
36-
async count(match, options) {
37-
return this.collection.count(match, options);
36+
async countDocuments(match, options) {
37+
return this.collection.countDocuments(match, options);
38+
}
39+
40+
/**
41+
* estimatedDocumentCount(match, options)
42+
*/
43+
async estimatedDocumentCount(match, options) {
44+
return this.collection.estimatedDocumentCount(match, options);
3845
}
3946

4047
/**
@@ -93,6 +100,13 @@ class NodeCollection extends Collection {
93100
return this.collection.findOneAndUpdate(match, update, options);
94101
}
95102

103+
/**
104+
* findOneAndReplace(match, update, options)
105+
*/
106+
async findOneAndReplace(match, update, options) {
107+
return this.collection.findOneAndReplace(match, update, options);
108+
}
109+
96110
/**
97111
* var cursor = findCursor(match, options)
98112
*/

0 commit comments

Comments
 (0)