Skip to content
Open

v6 #141

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ permissions:
jobs:
test:
# os is not in the matrix, because otherwise there would be way too many testing instances
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [14, 16, 18]
mongo: [4.2, 5.0]
node: ['lts/*', 'lts/-1', 'latest']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe CI failed b/c we also need uses: actions/setup-node@v4 here to support nvm syntax. Worth a try. Here's how I'm using it.

mongo: [7.0, 8.0]
services:
mongodb:
image: mongo:${{ matrix.mongo }}
Expand Down
4 changes: 3 additions & 1 deletion lib/collection/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const methods = [
'updateMany',
'updateOne',
'replaceOne',
'count',
'countDocuments',
'estimatedDocumentCount',
'distinct',
'findOneAndDelete',
'findOneAndReplace',
'findOneAndUpdate',
'aggregate',
'findCursor',
Expand Down
20 changes: 17 additions & 3 deletions lib/collection/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ class NodeCollection extends Collection {
}

/**
* count(match, options)
* countDocuments(match, options)
*/
async count(match, options) {
return this.collection.count(match, options);
async countDocuments(match, options) {
return this.collection.countDocuments(match, options);
}

/**
* estimatedDocumentCount(match, options)
*/
async estimatedDocumentCount(match, options) {
return this.collection.estimatedDocumentCount(match, options);
}

/**
Expand Down Expand Up @@ -93,6 +100,13 @@ class NodeCollection extends Collection {
return this.collection.findOneAndUpdate(match, update, options);
}

/**
* findOneAndReplace(match, update, options)
*/
async findOneAndReplace(match, update, options) {
return this.collection.findOneAndReplace(match, update, options);
}

/**
* var cursor = findCursor(match, options)
*/
Expand Down
Loading
Loading