Skip to content

Commit 1213d5c

Browse files
crobinson42jmdobry
authored andcommitted
Js docs (#28)
* fix(test): demo fix testing semantic-release * test(update.test.js): comment out unused code * docs(): small docs changes * test(): add custom mongodb query test
1 parent de461ee commit 1213d5c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const DEFAULTS = {
1717
*/
1818
translateId: true,
1919
/**
20-
* Convert fields of record from databse that are ObjectIDs to strings
20+
* Convert fields of record from database that are ObjectIDs to strings
21+
*
22+
* @name MongoDBAdapter#translateObjectIDs
2123
* @type {Boolean}
2224
* @default false
2325
*/
@@ -78,6 +80,7 @@ const REMOVE_OPTS_DEFAULTS = {}
7880
* @param {boolean} [opts.raw=false] See {@link Adapter#raw}.
7981
* @param {object} [opts.removeOpts] See {@link MongoDBAdapter#removeOpts}.
8082
* @param {boolean} [opts.translateId=true] See {@link MongoDBAdapter#translateId}.
83+
* @param {boolean} [opts.translateObjectIDs=false] See {@link MongoDBAdapter#translateObjectIDs}.
8184
* @param {object} [opts.updateOpts] See {@link MongoDBAdapter#updateOpts}.
8285
* @param {string} [opts.uri="mongodb://localhost:27017"] See {@link MongoDBAdapter#uri}.
8386
*/
@@ -172,7 +175,7 @@ export function MongoDBAdapter (opts) {
172175
utils.fillIn(this.updateOpts, UPDATE_OPTS_DEFAULTS)
173176

174177
/**
175-
* Default options to pass to collection#update.
178+
* Default options to pass to collection#destroy.
176179
*
177180
* @name MongoDBAdapter#removeOpts
178181
* @type {object}

test/find.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,13 @@ describe('MongoDBAdapter#find', function () {
9292
assert.objectsEqual(userList, [{ _id: id, name: 'John' }])
9393
})
9494
})
95+
96+
it('should allow use of node-mongodb-native via adapter.client', function () {
97+
return adapter.client.then((db) => {
98+
assert.ok(db.collection('user'))
99+
})
100+
.catch((err) => {
101+
throw new Error(err)
102+
})
103+
})
95104
})

0 commit comments

Comments
 (0)