-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add "sensible" default behaviour for the CLI update
command
#17
Conversation
…sampling with default sample size of 10
Some(schema_bson) => { | ||
let validator_schema = | ||
from_bson::<ValidatorSchema>(schema_bson.clone()).map_err(|err| { | ||
MongoAgentError::BadCollectionSchema( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the collection has a something in $jsonSchema
that can't be parsed as a ValidatorSchema
then we treat this as an error. Perhaps we should just log this and continue, in which case we would fall back to sampling for this collection. But I think it's probably better to treat it as an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
CHANGELOG.md
Outdated
- Use separate schema files for each collection | ||
- Don't sample from collections that already have a schema | ||
- Changes to `update` CLI command: | ||
- new default behaviour: | ||
- attempt to use validator schema if available | ||
- if no validator schema then sample documents from the collection | ||
- don't sample from collections that already have a schema | ||
- if no --sample-size given on command line, default sample size is 10 | ||
- new option --no-validator-schema to disable attempting to use validator schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we link to the PRs for these changelog entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Describe your changes
Attempt to provide some "sensible" default behaviour for the
update
command if no command line parameters are given.The idea is to have something that will work well for most users when run from
ddn quickstart
orddn dev
.--sample-size
is given on the command line then default to a sample size of 10.--no-validator-schema
which overrides the default behaviour and prevents the command from attempting to use validator schemas.Issue ticket number and link
MDB-83