Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken authored and emadum committed Mar 29, 2021
1 parent 215530b commit 9406494
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 34 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

The official [MongoDB](https://www.mongodb.com/) driver for Node.js.

**NOTE: v4.x was recently released with breaking API changes. You can find a list of changes [here](docs/CHANGES_4.0.0.md).**
**NOTE: v4.x was recently released with breaking API changes. You can find a list of changes [here](https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md).**

## Quick Links

| what | where |
|---------------|------------------------------------------------------------------------------------------------------------------|
| documentation | [https://docs.mongodb.com/drivers/node](https://docs.mongodb.com/drivers/node) |
| api-doc | [https://mongodb.github.io/node-mongodb-native/4.0/api/](https://mongodb.github.io/node-mongodb-native/4.0/api/) |
| api-doc | [https://mongodb.github.io/node-mongodb-native/4.0/](https://mongodb.github.io/node-mongodb-native/4.0/) |
| npm package | [https://www.npmjs.com/package/mongodb](https://www.npmjs.com/package/mongodb) |
| source | [https://github.com/mongodb/node-mongodb-native](https://github.com/mongodb/node-mongodb-native) |
| mongodb | [https://www.mongodb.com](https://www.mongodb.com) |
Expand All @@ -32,7 +32,7 @@ For issues with, questions about, or feedback for the Node.js driver, please loo

### Change Log

Change history can be found in [`HISTORY.md`](HISTORY.md).
Change history can be found in [`HISTORY.md`](https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md).

### Compatibility

Expand Down Expand Up @@ -64,7 +64,7 @@ The MongoDB driver depends on several other packages. These are:
- [kerberos](https://github.com/mongodb-js/kerberos)
- [mongodb-client-encryption](https://github.com/mongodb/libmongocrypt#readme)

Some of these packages include native C++ extensions, consult the [trouble shooting guide here](docs/native-extensions.md) if you run into issues.
Some of these packages include native C++ extensions, consult the [trouble shooting guide here](https://github.com/mongodb/node-mongodb-native/blob/4.0/docs/native-extensions.md) if you run into issues.

## Quick Start

Expand Down Expand Up @@ -235,4 +235,4 @@ For more detailed information, see the [indexing strategies page](https://docs.m
[Apache 2.0](LICENSE.md)

© 2009-2012 Christian Amor Kvalheim
© 2012-present MongoDB [Contributors](CONTRIBUTORS.md)
© 2012-present MongoDB [Contributors](https://github.com/mongodb/node-mongodb-native/blob/4.0/CONTRIBUTORS.md)
5 changes: 1 addition & 4 deletions src/operations/estimated_document_count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ export class EstimatedDocumentCountOperation extends CommandOperation<number> {
options: EstimatedDocumentCountOptions;
collectionName: string;

constructor(collection: Collection, options?: EstimatedDocumentCountOptions) {
if (typeof options === 'undefined') {
options = {} as EstimatedDocumentCountOptions;
}
constructor(collection: Collection, options: EstimatedDocumentCountOptions = {}) {
super(collection, options);
this.options = options;
this.collectionName = collection.collectionName;
Expand Down
12 changes: 1 addition & 11 deletions test/functional/crud_spec.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,17 +445,7 @@ describe('CRUD unified', function () {
it(String(test.description), {
metadata: { sessions: { skipLeakTests: true } },
test: async function () {
try {
await runUnifiedTest(this, crudSpecTest, test);
} catch (error) {
if (error.message.includes('not implemented.')) {
console.log(`${test.description}: was skipped due to missing functionality`);
console.log(error.stack);
this.skip();
} else {
throw error;
}
}
await runUnifiedTest(this, crudSpecTest, test);
}
});
}
Expand Down
12 changes: 1 addition & 11 deletions test/functional/versioned-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,7 @@ describe('Versioned API', function () {
it(String(test.description), {
metadata: { sessions: { skipLeakTests: true } },
test: async function () {
try {
await runUnifiedTest(this, versionedApiTest, test);
} catch (error) {
if (error.message.includes('not implemented.')) {
console.log(`${test.description}: was skipped due to missing functionality`);
console.log(error.stack);
this.skip();
} else {
throw error;
}
}
await runUnifiedTest(this, versionedApiTest, test);
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions test/unit/sessions/collection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Sessions - unit/sessions', function () {
}
});

it.skip('does not mutate command options', {
it('does not mutate command options', {
metadata: { requires: { topology: 'single' } },

test: function () {
Expand All @@ -63,7 +63,7 @@ describe('Sessions - unit/sessions', function () {
const doc = request.document;
if (doc.ismaster) {
request.reply(mock.DEFAULT_ISMASTER_36);
} else if (doc.count || doc.endSessions) {
} else if (doc.count || doc.aggregate || doc.endSessions) {
request.reply({ ok: 1 });
}
});
Expand All @@ -72,7 +72,7 @@ describe('Sessions - unit/sessions', function () {
return client.connect().then(client => {
const coll = client.db('foo').collection('bar');

return coll.count({}, options).then(() => {
return coll.countDocuments({}, options).then(() => {
expect(options).to.deep.equal({});
return client.close();
});
Expand Down

0 comments on commit 9406494

Please sign in to comment.