check record exist mongodb async driver java

113 Views Asked by At

Im trying to check if record ecist in my single db using mongo async driver but this dosen t seem to work correctly so what is the most efficient way to check record exist using this stack ,

Im doing simple check like :

if(collection.find(new document(..)).limit(0)==null)
then insert in database 

But this dosen t insert any document in the database !!

0

There are 0 best solutions below