Skip to content
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

In place updates for MongoDB back end #45

Open
sullivan- opened this issue Sep 22, 2017 · 0 comments
Open

In place updates for MongoDB back end #45

sullivan- opened this issue Sep 22, 2017 · 0 comments

Comments

@sullivan-
Copy link
Member

Implement Repo.inplace.updateByKeyVal and Repo.inplace.updateByQuery to do updates "in place", or on the database.

  • See In place deletes #43 for discussion of Repo.inplace
  • Depends on DSL to describe the "update" clause for an in place update #44.
  • The first has two arguments: UpdateClause and key value. See Repo.retrieve for how to properly constrain the type of the key value. See how Query is constrained in Repo.queryBy* methods to see how to constrain the UpdateClause.
  • The second has two arguments: UpdateClause and Query.
  • Make it so! Examine how query objects are translated into mongo queries in MongoQuery to get some ideas on how to form the update clause.
  • You should probably write an implementation for InMem back end at the same time; It won't be that hard.
  • Attempting these operations on a JDBC or Cassandra back end can just throw exception for now.
  • Add an integration test for updateByKeyVal in RepoCrudSpec. It should avoid running if the back end is not supported.
  • Add integration tests for updateByQuery in longevity.integration.queries. How to design the tests and just how many we need to cover cases will require some thought. Please try to keep reasonably minimal because these kinds of tests are expensive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant