User Story
As a Compass user
I want some help when writing my validation rules
So that I don’t need to remember the syntax of the validation operators, properties and their allowed values and the name of the fields of existing documents
Acceptance Criteria
- When I start typing the name of an existing field, an operator, a type or other keywords, the editor should suggest possible values
- Ideally, suggestions should be contextual, e.g. I should not be suggested a field name when I should be specifying the expected type of a field
- Autocompletion should work both for query operators as well as for JSON schema (including all the keywords specified here: http://docs.mongodb.com/manual/reference/operator/query/jsonSchema/#op._S_jsonSchema)
- When I get suggested possible values, I should be able to select one of the suggestions
- If none of the values that are suggested is the one I want, I should be able to type a different one
- A good use case for this is when I am creating validation rules for a field that does not exist in the documents already in the collection or when I am inserting rules for an empty collection: in these cases I should be able to type the field name even if it is not autocompleted
- The editor should support syntax highlighting for validation rules
- The editor should highlight errors and ideally give the user some hints on what the error is about
|