longevity
longevity copied to clipboard
In place updates for MongoDB back end
Implement Repo.inplace.updateByKeyVal and Repo.inplace.updateByQuery to do updates "in place", or on the database.
- See #43 for discussion of
Repo.inplace - Depends on #44.
- The first has two arguments:
UpdateClauseand key value. SeeRepo.retrievefor how to properly constrain the type of the key value. See howQueryis constrained inRepo.queryBy*methods to see how to constrain theUpdateClause. - The second has two arguments:
UpdateClauseandQuery. - Make it so! Examine how query objects are translated into mongo queries in
MongoQueryto get some ideas on how to form the update clause. - You should probably write an implementation for
InMemback end at the same time; It won't be that hard. - Attempting these operations on a
JDBCorCassandraback end can just throw exception for now. - Add an integration test for
updateByKeyValinRepoCrudSpec. It should avoid running if the back end is not supported. - Add integration tests for
updateByQueryinlongevity.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.