Document Id along with other data



My document id
“id”: “b2b_portal_4861dfbf-6ed3-4f37-90b5-f86df2afbdb3” and my document data is
“email”: "",
“password”: “12345689”,
“table_type”: “b2b_portal”

How can i get my document data with document id


META().id gives document id

SELECT MEAT(d).id, d.* FROM default AS d 
WHERE ......;


Hi @arafat15-1830. If you have the document id then also consider using the standard key-value SDK over N1QL, as it’ll be faster. If you’re on Java then it looks like this:

    JsonDocument doc = bucket.get("b2b_portal_4861dfbf-6ed3-4f37-90b5-f86df2afbdb3");
    String email = doc.content().getString("email");
    String id =;
    // etc...

Please see the SDK docs here for more info (if you’re using a different language, use the drop-down at the top.)


SELECT meta().id, * FROM catalog where email ="" AND table_type = “b2b_portal” ; by this query i get the document with id but when i write this query from node it only returns the {
“email”: "",
“password”: “12345689”,
“table_type”: “b2b_portal”

but not the document id .I am using node js.