Skip to content

Commit 0d16584

Browse files
Add docs change and config validator
1 parent 9b1f81f commit 0d16584

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/Config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class Config {
8585
allowExpiredAuthDataToken,
8686
logLevels,
8787
rateLimit,
88+
azureCosmosMongoDbCompatibleMode,
8889
databaseOptions,
8990
}) {
9091
if (masterKey === readOnlyMasterKey) {
@@ -120,6 +121,7 @@ export class Config {
120121
this.validateSchemaOptions(schema);
121122
this.validateEnforcePrivateUsers(enforcePrivateUsers);
122123
this.validateAllowExpiredAuthDataToken(allowExpiredAuthDataToken);
124+
this.validateAzureCosmosMongoDbCompatibleMode(azureCosmosMongoDbCompatibleMode);
123125
this.validateRequestKeywordDenylist(requestKeywordDenylist);
124126
this.validateRateLimit(rateLimit);
125127
this.validateLogLevels(logLevels);
@@ -166,6 +168,12 @@ export class Config {
166168
}
167169
}
168170

171+
static validateAzureCosmosMongoDbCompatibleMode(azureCosmosMongoDbCompatibleMode) {
172+
if (typeof azureCosmosMongoDbCompatibleMode !== 'boolean') {
173+
throw 'Parse Server option azureCosmosMongoDbCompatibleMode must be a boolean.';
174+
}
175+
}
176+
169177
static validateSecurityOptions(security) {
170178
if (Object.prototype.toString.call(security) !== '[object Object]') {
171179
throw 'Parse Server option security must be an object.';

src/Options/Definitions.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ module.exports.ParseServerOptions = {
103103
'Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication',
104104
action: parsers.arrayParser,
105105
},
106+
azureCosmosMongoDbCompatibleMode: {
107+
env: 'PARSE_SERVER_AZURE_COSMOS_MONGO_DB_COMPATIBLE_MODE',
108+
help:
109+
'Set to true for running against Azure Cosmos for Mongo DB. This can bring some performance loss.',
110+
action: parsers.booleanParser,
111+
default: false,
112+
},
106113
cacheAdapter: {
107114
env: 'PARSE_SERVER_CACHE_ADAPTER',
108115
help: 'Adapter module for the cache',

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.

0 commit comments

Comments
 (0)