Skip to content

Remove unsupported db options from mongo connection #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

omairvaiyani
Copy link

@omairvaiyani omairvaiyani commented Mar 8, 2023

A new set of Parse Config options were added in v6 to databaseOptions called enableSchemaHooks and schemaCacheTtl. However, these options are not strictly speaking database options, they instead manage Parse's internal behaviour with relation to the database. This means that MongoDB doesn't recognise these options and so, they must not be passed into the MongoDB client constructor.

This was correctly handled in the MongoStorageAdapter where the new, non-mongodb options are deleted - Screenshot 1 before they're used as MongoDB client options.

However, there remains another area where the unsupported options are passed to a MongoDB client. You can see in Screenshot 2 that _mongoOptions is used directly when connecting to the MongoDB client in the GridFSBucketAdapter.
This is where an error is thrown (screenshots 3 and 4) if a Parse Server uses the new enableSchemaHooks or schemaCacheTtl options.

Screenshot 1
image

Screenshot 2
image

Screenshot 3
image

Screenshot 4
image

@egmacke egmacke merged commit ca37e39 into alpha Mar 8, 2023
JacobWithACapitalJ pushed a commit that referenced this pull request Oct 29, 2024
* Remove unsupported db options from mongo connection

* Add maxTimeMS to filter list
@egmacke egmacke deleted the remove-unsupported-db-options-storage-adapter branch March 10, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants