File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
test/functional/com/mongodb Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,9 @@ public String apply(final DBObject result) {
251251 * @mongodb.driver.manual reference/method/db.createCollection/ createCollection()
252252 */
253253 public DBCollection createCollection (final String collectionName , final DBObject options ) {
254- executor .execute (getCreateCollectionOperation (collectionName , options ));
254+ if (options != null ) {
255+ executor .execute (getCreateCollectionOperation (collectionName , options ));
256+ }
255257 return getCollection (collectionName );
256258 }
257259
Original file line number Diff line number Diff line change @@ -117,6 +117,13 @@ public void shouldReceiveAnErrorIfCreatingCappedCollectionWithoutSize() {
117117 database .createCollection ("someName" , new BasicDBObject ("capped" , true ));
118118 }
119119
120+ @ Test
121+ public void shouldDeferCollectionCreationIfOptionsIsNull () {
122+ collection .drop ();
123+ database .createCollection (collectionName , null );
124+ assertFalse (database .getCollectionNames ().contains (collectionName ));
125+ }
126+
120127 @ Test
121128 public void shouldCreateCappedCollection () {
122129 collection .drop ();
You can’t perform that action at this time.
0 commit comments