Is there any way to get the size of a document using a N1QL query. I have seen it done using a view here:
http://blog.couchbase.com/calculating-average-document-size-documents-stored-couchbase
Is there any way to get the size of a document using a N1QL query. I have seen it done using a view here:
http://blog.couchbase.com/calculating-average-document-size-documents-stored-couchbase
how about something like this - this would give you the encoded size for each doc.
select length(ENCODE_JSON(default)) from default;
By the way, you can find more about the JSON functions here in the docs: http://developer.couchbase.com/documentation/server/4.5/n1ql/n1ql-language-reference/jsonfun.html
Thank you. Those suggestions worked well.
I unable to find out the Doc size , can some one please help with step by step with a bucket name travel
SELECT META(t).id, length(ENCODE_JSON(t)) AS size
FROM `travel-sample` AS t
LIMIT 3;
"results": [
{
"id": "airline_10",
"size": 120
},
{
"id": "airline_10123",
"size": 118
},
{
"id": "airline_10226",
"size": 116
}
]
yeah , you are correct