diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index cf8072dc91..bcd8a6dc1e 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -31,7 +31,7 @@ module.exports.SchemaOptions = { keepUnknownIndexes: { env: 'PARSE_SERVER_SCHEMA_KEEP_UNKNOWN_INDEXES', help: - 'Keep indexes that are not defined in the schema and are present in the database. Set this to true if you are adding indexes manually so that it wont be dropped when you run schema migration', + "(Optional) Keep indexes that are present in the database but not defined in the schema. Set this to `true` if you are adding indexes manually, so that they won't be removed when running schema migration. Default is `false`.", action: parsers.booleanParser, default: false, }, @@ -1083,6 +1083,11 @@ module.exports.DatabaseOptions = { action: parsers.booleanParser, default: false, }, + ignoreUndefined: { + env: 'PARSE_SERVER_DATABASE_IGNORE_UNDEFINED', + help: 'The MongoDB driver option to set whether to ignore undefined values in BSON documents.', + action: parsers.booleanParser, + }, maxPoolSize: { env: 'PARSE_SERVER_DATABASE_MAX_POOL_SIZE', help: @@ -1124,11 +1129,6 @@ module.exports.DatabaseOptions = { '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.', action: parsers.numberParser('socketTimeoutMS'), }, - ignoreUndefined: { - env: 'PARSE_SERVER_DATABASE_IGNORE_UNDEFINED', - help: 'The MongoDB driver option to set whether to ignore undefined values in BSON documents.', - action: parsers.booleanParser, - }, }; module.exports.AuthAdapter = { enabled: { diff --git a/src/Options/docs.js b/src/Options/docs.js index a25cda57d2..511175d1c1 100644 --- a/src/Options/docs.js +++ b/src/Options/docs.js @@ -4,7 +4,7 @@ * @property {Function} beforeMigration Execute a callback before running schema migrations. * @property {Any} definitions Rest representation on Parse.Schema https://docs.parseplatform.org/rest/guide/#adding-a-schema * @property {Boolean} deleteExtraFields Is true if Parse Server should delete any fields not defined in a schema definition. This should only be used during development. - * @property {Boolean} keepUnknownIndexes Keep indexes that are not defined in the schema and are present in the database. Set this to true if you are adding indexes manually so that it wont be dropped when you run schema migration + * @property {Boolean} keepUnknownIndexes (Optional) Keep indexes that are present in the database but not defined in the schema. Set this to `true` if you are adding indexes manually, so that they won't be removed when running schema migration. Default is `false`. * @property {Boolean} lockSchemas Is true if Parse Server will reject any attempts to modify the schema while the server is running. * @property {Boolean} recreateModifiedFields Is true if Parse Server should recreate any fields that are different between the current database schema and theschema definition. This should only be used during development. * @property {Boolean} strict Is true if Parse Server should exit if schema update fail. @@ -240,6 +240,7 @@ * @property {Number} autoSelectFamilyAttemptTimeout 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. * @property {Number} connectTimeoutMS The MongoDB driver option to specify the amount of time, in milliseconds, to wait to establish a single TCP socket connection to the server before raising an error. Specifying 0 disables the connection timeout. * @property {Boolean} enableSchemaHooks Enables database real-time hooks to update single schema cache. Set to `true` if using multiple Parse Servers instances connected to the same database. Failing to do so will cause a schema change to not propagate to all instances and re-syncing will only happen when the instances restart. To use this feature with MongoDB, a replica set cluster with [change stream](https://docs.mongodb.com/manual/changeStreams/#availability) support is required. + * @property {Boolean} ignoreUndefined The MongoDB driver option to set whether to ignore undefined values in BSON documents. * @property {Number} maxPoolSize The MongoDB driver option to set the maximum number of opened, cached, ready-to-use database connections maintained by the driver. * @property {Number} maxStalenessSeconds The MongoDB driver option to set the maximum replication lag for reads from secondary nodes. * @property {Number} maxTimeMS The MongoDB driver option to set a cumulative time limit in milliseconds for processing operations on a cursor. @@ -247,7 +248,6 @@ * @property {Boolean} retryWrites The MongoDB driver option to set whether to retry failed writes. * @property {Number} schemaCacheTtl The duration in seconds after which the schema cache expires and will be refetched from the database. Use this option if using multiple Parse Servers instances connected to the same database. A low duration will cause the schema cache to be updated too often, causing unnecessary database reads. A high duration will cause the schema to be updated too rarely, increasing the time required until schema changes propagate to all server instances. This feature can be used as an alternative or in conjunction with the option `enableSchemaHooks`. Default is infinite which means the schema cache never expires. * @property {Number} socketTimeoutMS 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. - * @property {Boolean} ignoreUndefined The MongoDB driver option to set whether to ignore undefined values in BSON documents. */ /** diff --git a/src/Options/index.js b/src/Options/index.js index 6522ede054..9ba3727c2b 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -25,7 +25,7 @@ export interface SchemaOptions { /* Is true if Parse Server will reject any attempts to modify the schema while the server is running. :DEFAULT: false */ lockSchemas: ?boolean; - /* Keep indexes that are not defined in the schema and are present in the database. Set this to true if you are adding indexes manually so that it wont be dropped when you run schema migration + /* (Optional) Keep indexes that are present in the database but not defined in the schema. Set this to `true` if you are adding indexes manually, so that they won't be removed when running schema migration. Default is `false`. :DEFAULT: false */ keepUnknownIndexes: ?boolean; /* Execute a callback before running schema migrations. */