Skip to content

CreateCollection silently drops supported options #79

@jsonking

Description

@jsonking

The CreateCollectionChange silently drops valid options allowed by the server (only retaining the validation 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's CreateCollectionOptions 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions