Skip to content

Commit c466ec5

Browse files
committed
add ignoreUndefined database option
1 parent 1bb1b39 commit c466ec5

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

spec/ParseConfigKey.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ describe('Config Keys', () => {
8585
connectTimeoutMS: 5000,
8686
socketTimeoutMS: 5000,
8787
autoSelectFamily: true,
88-
autoSelectFamilyAttemptTimeout: 3000
88+
autoSelectFamilyAttemptTimeout: 3000,
89+
ignoreUndefined: true,
8990
},
9091
})).toBeResolved();
9192
expect(loggerErrorSpy.calls.all().reduce((s, call) => s += call.args[0], '')).not.toMatch(invalidKeyErrorMessage);

src/Options/Definitions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,11 @@ module.exports.DatabaseOptions = {
11171117
'The MongoDB driver option to specify the amount of time, in milliseconds, spent attempting to send or receive on a socket before timing out. Specifying 0 means no timeout.',
11181118
action: parsers.numberParser('socketTimeoutMS'),
11191119
},
1120+
ignoreUndefined: {
1121+
env: 'PARSE_SERVER_DATABASE_IGNORE_UNDEFINED',
1122+
help: 'The MongoDB driver option to set whether to ignore undefined values in BSON documents.',
1123+
action: parsers.booleanParser,
1124+
},
11201125
};
11211126
module.exports.AuthAdapter = {
11221127
enabled: {

src/Options/docs.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ export interface DatabaseOptions {
618618
autoSelectFamily: ?boolean;
619619
/* The MongoDB driver option to specify the amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the autoSelectFamily option. If set to a positive integer less than 10, the value 10 is used instead. */
620620
autoSelectFamilyAttemptTimeout: ?number;
621+
/* The MongoDB driver option to set whether to ignore undefined values in BSON documents. */
622+
ignoreUndefined: ?boolean;
621623
}
622624

623625
export interface AuthAdapter {

0 commit comments

Comments
 (0)