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

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.