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) {
251
251
* @mongodb.driver.manual reference/method/db.createCollection/ createCollection()
252
252
*/
253
253
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
+ }
255
257
return getCollection (collectionName );
256
258
}
257
259
Original file line number Diff line number Diff line change @@ -117,6 +117,13 @@ public void shouldReceiveAnErrorIfCreatingCappedCollectionWithoutSize() {
117
117
database .createCollection ("someName" , new BasicDBObject ("capped" , true ));
118
118
}
119
119
120
+ @ Test
121
+ public void shouldDeferCollectionCreationIfOptionsIsNull () {
122
+ collection .drop ();
123
+ database .createCollection (collectionName , null );
124
+ assertFalse (database .getCollectionNames ().contains (collectionName ));
125
+ }
126
+
120
127
@ Test
121
128
public void shouldCreateCappedCollection () {
122
129
collection .drop ();
You can’t perform that action at this time.
0 commit comments