Skip to content

Commit 60b446c

Browse files
committed
Merge branch 'release-5.0.2'
2 parents 5f7bd64 + 44c4f8d commit 60b446c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const DATABASE_SCHEMA = {
1616
},
1717
default: {
1818
default: false,
19-
doc: '',
19+
doc: 'Whether this database should be used as the default (main) database',
2020
envTemplate: 'DB_{database}_DEFAULT',
2121
format: Boolean
2222
},
2323
hosts: {
24-
default: '',
24+
default: 'Comma-separated string of MongoDB hosts, including port (e.g. localhost,localhost:27018,localhost:27019)',
2525
doc: 'Database hosts',
2626
format: String,
2727
envTemplate: 'DB_{database}_HOSTS'
@@ -38,28 +38,28 @@ const DATABASE_SCHEMA = {
3838
envTemplate: 'DB_{database}_MAX_POOL'
3939
},
4040
password: {
41-
doc: '',
41+
doc: 'The access password, if one is needed',
4242
format: String,
4343
default: '',
4444
envTemplate: 'DB_{database}_PASSWORD'
4545
},
4646
readPreference: {
47-
doc: 'Choose how MongoDB routes read operations to the members of a replica set - see https://docs.mongodb.com/manual/reference/read-preference/',
47+
doc: 'How MongoDB routes read operations to the members of a replica set - see https://docs.mongodb.com/manual/reference/read-preference/',
4848
format: ['primary', 'primaryPreferred', 'secondary', 'secondaryPreferred', 'nearest'],
4949
default: 'secondaryPreferred'
5050
},
5151
replicaSet: {
52-
doc: '',
52+
doc: 'The name of the replica set to identify the hosts',
5353
format: String,
5454
default: ''
5555
},
5656
ssl: {
57-
doc: '',
57+
doc: 'Whether to initiate the connection with TLS/SSL',
5858
format: Boolean,
5959
default: false
6060
},
6161
username: {
62-
doc: '',
62+
doc: 'The access username, if one is needed',
6363
format: String,
6464
default: '',
6565
envTemplate: 'DB_{database}_USERNAME'

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ DataStore.prototype.createObjectIdFromString = function (query) {
416416

417417
if (Array.isArray(value)) {
418418
value = value.map(childValue => {
419-
if (ObjectID.isValid(childValue)) {
419+
if (typeof childValue === 'string' && ObjectID.isValid(childValue)) {
420420
return ObjectID.createFromHexString(childValue)
421421
}
422422

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dadi/api-mongodb",
3-
"version": "5.0.1",
3+
"version": "5.0.2",
44
"description": "A MongoDB adapter for DADI API",
55
"keywords": [
66
"dadi",

0 commit comments

Comments
 (0)