This is prerequisite for any further updateByKeyVal or updateByQuery work.
- I would recommend keeping it simple at first.
- Follow
longevity.model.query.QueryFilter as a rough model.
- Basic structure is
<prop> 'gets' <update-expr>
- Provide both an operator (
:= maybe) and a pneumonic equivalent such as gets)
- It's probably a good idea to restrict it to basic properties for the time being (i.e., things like ints and strings, not things like nested components, sets and lists)
- The update expression will vary by type; LHS and RHS have to match on type
- update expression should allow for literals, basic properties, and basic operators over the types such as addition, logical or, string concatenation, etc.
- Please do write some unit tests to make sure the DSL is fluent
- When in doubt, ask @sullivan- he will be happy to help
In the future, we might add support for things like:
- collections and nested components
- specialized operators such as
incr that can either rely on underlying DB operators such as MongoDB's $inc, or be expanded into equivalent expression e.g. x + 1
This is prerequisite for any further
updateByKeyValorupdateByQuerywork.longevity.model.query.QueryFilteras a rough model.<prop> 'gets' <update-expr>:=maybe) and a pneumonic equivalent such asgets)In the future, we might add support for things like:
incrthat can either rely on underlying DB operators such as MongoDB's$inc, or be expanded into equivalent expression e.g.x + 1