Skip to content

Commit 4c1039d

Browse files
committed
fix options docs
1 parent 0dec358 commit 4c1039d

File tree

4 files changed

+35
-40
lines changed

4 files changed

+35
-40
lines changed

README.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -754,36 +754,6 @@ Logs are also viewable in Parse Dashboard.
754754
755755
**Want new line delimited JSON error logs (for consumption by CloudWatch, Google Cloud Logging, etc)?** Pass the `JSON_LOGS` environment variable when starting `parse-server`. Usage :- `JSON_LOGS='1' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
756756
757-
### MongoDB Client Event Logging
758-
759-
Monitor MongoDB driver behavior by logging specific client events. This is useful for debugging connection issues, tracking topology changes, and monitoring connection pool health.
760-
761-
```js
762-
const server = new ParseServer({
763-
databaseOptions: {
764-
logClientEvents: [
765-
{
766-
name: 'serverDescriptionChanged',
767-
keys: ['address', 'previousDescription.type', 'newDescription.type'],
768-
logLevel: 'warn'
769-
},
770-
{
771-
name: 'connectionPoolCleared',
772-
keys: ['address', 'serviceId'],
773-
logLevel: 'error'
774-
}
775-
]
776-
}
777-
});
778-
```
779-
780-
Each event configuration requires:
781-
- `name` - The MongoDB driver event (e.g., `topologyDescriptionChanged`, `connectionPoolReady`)
782-
- `keys` - (Optional) Dot-notation paths to extract specific data; omit to log the entire event
783-
- `logLevel` - Log level: `error`, `warn`, `info`, or `debug`
784-
785-
See [MongoDB driver events documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/monitoring/) for available events.
786-
787757
# Deprecations
788758
789759
See the [Deprecation Plan](https://github.com/parse-community/parse-server/blob/master/DEPRECATIONS.md) for an overview of deprecations and planned breaking changes.

src/Options/Definitions.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,25 @@ module.exports.FileUploadOptions = {
10831083
default: ['^(?![xXsS]?[hH][tT][mM][lL]?$)'],
10841084
},
10851085
};
1086+
module.exports.LogClientEvent = {
1087+
keys: {
1088+
env: 'undefinedKEYS',
1089+
help:
1090+
'Optional array of dot-notation paths to extract specific data from the event object. If not provided or empty, the entire event object will be logged.',
1091+
action: parsers.arrayParser,
1092+
},
1093+
logLevel: {
1094+
env: 'undefinedLOG_LEVEL',
1095+
help: 'The log level to use for this event.',
1096+
required: true,
1097+
},
1098+
name: {
1099+
env: 'undefinedNAME',
1100+
help:
1101+
'The MongoDB driver event name to listen for. See the [MongoDB driver events documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/monitoring/) for available events.',
1102+
required: true,
1103+
},
1104+
};
10861105
module.exports.DatabaseOptions = {
10871106
appName: {
10881107
env: 'PARSE_SERVER_DATABASE_APP_NAME',
@@ -1221,8 +1240,7 @@ module.exports.DatabaseOptions = {
12211240
},
12221241
logClientEvents: {
12231242
env: 'PARSE_SERVER_DATABASE_LOG_CLIENT_EVENTS',
1224-
help:
1225-
"An array of MongoDB client event configurations to enable logging of specific events. Each configuration object should contain:<br><ul><li>`name` (the event name, e.g., 'topologyDescriptionChanged', 'serverDescriptionChanged', 'connectionPoolCleared', 'connectionPoolReady')</li><li>`keys` (optional array of dot-notation paths to extract specific data from the event object; if not provided or empty, the entire event object will be logged)</li><li>`logLevel` (the log level to use for this event: 'error', 'warn', 'info', 'debug', etc.).</li></ul>",
1243+
help: 'An array of MongoDB client event configurations to enable logging of specific events.',
12261244
action: parsers.arrayParser,
12271245
},
12281246
maxConnecting: {

src/Options/docs.js

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -608,14 +608,14 @@ export interface FileUploadOptions {
608608
enableForPublic: ?boolean;
609609
}
610610

611-
export type LogClientEvent = {
612-
/* The MongoDB driver event name to listen for. */
613-
name: string,
611+
export interface LogClientEvent {
612+
/* The MongoDB driver event name to listen for. See the [MongoDB driver events documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/monitoring/) for available events. */
613+
name: string;
614614
/* Optional array of dot-notation paths to extract specific data from the event object. If not provided or empty, the entire event object will be logged. */
615-
keys?: string[],
615+
keys: ?(string[]);
616616
/* The log level to use for this event. */
617-
logLevel: string,
618-
};
617+
logLevel: string;
618+
}
619619

620620
export interface DatabaseOptions {
621621
/* 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.
@@ -734,7 +734,7 @@ export interface DatabaseOptions {
734734
createIndexRoleName: ?boolean;
735735
/* Set to `true` to disable validation of index fields. When disabled, indexes can be created even if the fields do not exist in the schema. This can be useful when creating indexes on fields that will be added later. */
736736
disableIndexFieldValidation: ?boolean;
737-
/* An array of MongoDB client event configurations to enable logging of specific events. Each configuration object should contain:<br><ul><li>`name` (the event name, e.g., 'topologyDescriptionChanged', 'serverDescriptionChanged', 'connectionPoolCleared', 'connectionPoolReady')</li><li>`keys` (optional array of dot-notation paths to extract specific data from the event object; if not provided or empty, the entire event object will be logged)</li><li>`logLevel` (the log level to use for this event: 'error', 'warn', 'info', 'debug', etc.).</li></ul> */
737+
/* An array of MongoDB client event configurations to enable logging of specific events. */
738738
logClientEvents: ?(LogClientEvent[]);
739739
}
740740

0 commit comments

Comments
 (0)