[JAVA-116] Would like to know if a collection already exists without automatically creating one Created: 22/May/10  Updated: 29/Oct/10  Resolved: 24/May/10

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Type: Improvement Priority: Minor - P4
Reporter: Daniel Kunnath Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 0001-Updated-DB-API-to-include-method-to-check-for-the-ex.patch    

 Description   

I have a use case in which I would like to check for the existence of a collection without creating a new one automatically if it already exists.

I am new to MongoDB, but I'm proposing a change to DB.java to add this functionality.

I've updated to include:
public boolean collectionExists(String collectionName)

and the test for it in DBTest.java.

The attached patch includes the changes (created from my github fork of the driver project).

Please consider it for inclusion.

Thanks!



 Comments   
Comment by Eliot Horowitz (Inactive) [ 24/May/10 ]

merged your patch via github (that's the best way to submit patches anyway)
thanks

Generated at Thu Feb 08 08:51:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.