Deleting specific documents from mongo in Java

Published: 31/01/2018
Deleting specific documents from mongo in Java
Source: STACKOVERFLOW.COM

I want to delete about 5 documents from my DB in Java/Groovy but I am not able to do so. I have following code. def deletedocuments() { for (int n = 0; n < collectionNames.size(); n++) { dbConnection.getCollection(collectionNames[n])**.remove** } } collectionNames is a arraylist of collections that I would like to delete data from. However, the 'remove' method is not available here. How do I

Read more
Related news
Comment
FACEBOOK