As I understand it, Couchbase stores documents as JSON.
On one of my API routes, I send in the response couchbase documents without making any changes to them. For each document, I call JSON.Stringify before sending it to the browser.
Is it possible to get the documents from couchbase as raw JSON, so that I could send them “as is” to the browser without needing to call JSON.stringify on each document ? In this way I could avoid the cost of deserializing and then reserializing the data on each call ?
There are different ways to store/retrieve data in couchbase. If you follow the common examples, yes, the data is strored and retrieved as JSON.
The SDKs can convert to/from JSON so there is no need for your application.
Also - de/serialization from/to JSON is fast - I haven’t found enough if a difference to make avoiding it worthwhile (also, n1ql won’t work on non-json documents)