Skip to content

Commit

Permalink
Fix: Added as update property
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster committed Jan 12, 2024
1 parent cf238e0 commit 3a68abc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -102,6 +102,7 @@ A subset of BSON Types https://www.mongodb.com/docs/manual/reference/bson-types/
2. 100% unit test coverage, from the mongodb website examples, for each supported operator, for each supported type
3. Query intellisense support using typescript types
4. Query schemas and validation supplied
5. `$where` can be used as an update operator, `$where: "this.title = this.title?.replace(/1 to 5/g, '1 to 10'); return true;"`

### Unsupported operators
#### [Evaluation query operators](https://www.mongodb.com/docs/manual/reference/operator/query-evaluation/)
Expand Down
5 changes: 4 additions & 1 deletion schema/update.schema.json
Expand Up @@ -46,10 +46,13 @@
},
"$unset": {
"$ref": "#/$defs/stringField"
},
"$where": {
"type": "string"
}
},
"propertyNames": {
"pattern": "(^[$](addToSet|currentDate|inc|max|min|mul|pop|pull|pullAll|push|rename|set|sort|unset)+)|(^[^$].*)"
"pattern": "(^[$](addToSet|currentDate|inc|max|min|mul|pop|pull|pullAll|push|rename|set|sort|unset|where)+)|(^[^$].*)"
},
"additionalProperties": false,
"$defs": {
Expand Down

0 comments on commit 3a68abc

Please sign in to comment.