Autogenerated key value

Everytime i have to set key value to insert documents. Is there anyway to setup auto generated key in couchbase with Java sdk?

1 Answer

« Back to question.

Hi, it is not possible directly, but what you can do easily is create a "unique key" document and use incr to get the next value and then generate your key from the returned value.