I am new to CouchDb/ektorp. According to the ektorp documentation you can generate couchdb views through an annotation like this:
@View( name = "avg_sofa_size", map = "function(doc) {...}", reduce = "function(doc) {...}")
Is there a way to get only the latest revison of each doc, not by id but another attribute? <-- not java specific
And if possible only get only one doc not by id but another attributefrom that view? <-- ektorp/java
Thakns
Couch always gives you the latest revision, unless you ask for a particular revision:
Returns latest revision of doc-123
Returns a specific revision of doc-123. (Revisions are kept by couch only for conflict resolution. They are removed during compaction and are not replicated, so you shouldn't necessarily count on them being there)
If you just want to get a document by id, there is no need to use a view. Looks like you want to do something like this with ektorp:
Where
Sofa
is a java class which extendsCouchDbDocument