Check the count of documents with keys having particular prefix without index

Is there any way to check the count of documents with keys having particular prefix without index in a particular bucket.

N1QL requires index or document keys. So it is not possible using the N1QL.
I am not expert but may be you can use map/reduce view.

Can you please tell how we can use map/reduce view.

@binu_kurian, if you know the length of the prefix you could use “substring” method of javascript. You can emit prefix of the key and value as 1. And in reduce function you can use “_count” in built function. For query group=true.
For example:
map function:
function (doc, meta) {
emit([meta.id.substring(0,1)], 1);
}

Reduce:
_count

Query:
http://127.0.0.1:892/Default/_design/try1/_view/view1?stale=false&connection_timeout=60000&inclusive_end=true&skip=0&full_set=true&group=true

Result:
{“rows”:[
{“key”:[“A”],“value”:100000},
{“key”:[“B”],“value”:1000},
{“key”:[“C”],“value”:1000}
]
}

Hi Ankit,

I am not able to open this link. Can you please help.

Thanks,
Binu.

That is your local cluster. You need to create view