Fetch keys across all documents in a bucket

is there a way to capture keys across all the documents in a bucket ?

thanks
CHakri

You can use N1QL

CREATE PRIMARY INDEX ON default;
start with key = “”
Repeat the following query until end

SELECT META().id 
FROM default 
WHERE META().id >  $key  LIMIT 1000;

key = last key

OR

 SELECT META().id 
    FROM default;
1 Like

thanks for sharing it…however, we dont have n1q1 and wondering if there is a way to get this done without n1q1

thanks
Chakri