I’m Scala/CouchDB newbie with a simple use case. I need to store some Scala case class instances into the CouchDB. The data in the instances are “almost” static (update happens only during my service restart).
All I need is:
- Insert the instance to CouchDB
- Get the instance from CouchDB
I’m trying to use Scouchdb (https://github.com/debasishg/scouchdb).
- I can use sjson for object
serialization, but I would expect
scouchdb to do it on its own. - I know
about by_id(id) and get(id) method for
retrieval, but I’m kinda not able to
figure it out – it seems all examples are out of date
Can anyone give me simple example (if such exists) how to achieve my goal?
And last but not least, is there any relation between dispatch-couch and scouchdb?
Thanks
The methods I needed are found on Db class
For inserting:
For retrieval there is:
See https://github.com/debasishg/scouchdb/blob/master/src/main/scala/scouch/db/Database.scala