-
Notifications
You must be signed in to change notification settings - Fork 47
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
CreateCollection silently drops supported options #79
Comments
Thank you @jsonking for you suggestion and PR. Please note I have add some cosmetic changes to you PR and merged |
Hi - Thanks @alexandru-slobodcicov - glad to have helped. Would appreciate if you could explain the role of the
Noticed that in the merged PR this class provides a default implementation:
The javadoc comment now mentions an exception ( i.e. feels like this should indeed be Thanks |
Hi @jsonking toJs is coming somewhere in DATABASECHANGELOG collection, suppose in description field. Don't think it shuld be that accurate and not critical. If you could really help with converting the possible Statements to the runCommand approach would help a lot. |
The
CreateCollectionChange
silently drops valid options allowed by the server (only retaining thevalidation
related ones if defined).This is a potential source of error as the user may not notice this when defining and running a changeset as the collection would be created without the options being present.
I have raised a PR for fixing this: #78
In the PR I have changed the implementation to issue a
runCommand
operation instead. This allows all supported database options to be defined in the changeset which are then passed through to the server. This is more future proof than using the driver'sCreateCollectionOptions
class which evolves over time and requires manually copying each option across.If you like this approach I am happy to help convert other similar methods to do the same (e.g.
createIndex
which recently had changes for a similar reason in Issue-74).┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: