Skip to content

DSL to describe the "update" clause for an in place update #44

Description

@sullivan-

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions