Including document key inside document?

Hi,

I intend to use automatic Java Pojo to json convertion and the other way round, with Jackson.
I'm trying to define my documents, client api and java pojo's so that with as less coding as possible, my Java pojo get's converted to json to inter-act with my clients and to couchbase.
I also use a library to create the pojo's from json schema objects to start with.

The key is part of all pojo's interacting with couchbase and with our client code.
In couchbase the key is part of the meta doc and does not have to be part of the document itself.
So if we don't have the key inside the document, we'll need to set it into our pojo manually after each get.

It would have been nice to have a optional selectable pseudo element let's say "doc_key" that could be added to the document by couchbase only during a get statement.

Apart from the fact that adding this key inside the document will take some disk space and memory, is this a bad practice?

Your advice will be appreciated.

Fred

0 Answers

No answers yet