I have a java application that reads an excel file. While I am processing the file row by row, I am doing a query N1QL to check if the Id (first cell of each row) is already in the couchbase. if not, it inserts it (bucket.insert(doc), otherwise it will upsert it.
Problem: the process is so fast that I insert a row and then if I try to insert the same one, the query doesn’t give any value (I believe it doesn’t have time to update the index)
What I tried so far:
- Use ScanConsistency.REQUEST_PLUS when I build the N1qlQuery object. - Didn’t work
I am using couchbase-client 1.4.13 and java-client 2.7.9