As a rule of thumb, all repository access methods which are not "by a specific key" require a backing view to find the one or more matching entities.
The views for this sample to work:
- For query by first name
function (doc, meta) {
if (doc._class == "com.couchbase.sample.dto.User" && doc.lastName) {
emit(doc.lastName, null);
}
}
- For query all documents
function (doc, meta) {
if (doc._class == "com.couchbase.sample.dto.User") {
emit(null, null);
}
}
More info on Spring Data Couchbase
##Sample payload
{
"id":"nickel_back",
"firstName":"Nickel",
"lastName":"Back",
"email":"a@b.com"
}