It works but not the way I expect…I want to get all the documents for which the property document.get(“NrInregistrare”) starts with NrInreg, something like WHERE NrInregistrare LIKE NrInreg+’%’

Also, for the query
query.setStartKey(Arrays.asList(dtpAn.getYear(), NrInreg));
query.setEndKey(Arrays.asList(dtpAn.getYear(), NrInreg, new HashMap<String, Object>()))
I get only the documents for which the property document.get(“NrInregistrare”) = NrInreg