@@ -422,8 +422,8 @@ public void TestBulkWriteUnordered()
422
422
_collection . Drop ( ) ;
423
423
_collection . BulkWrite ( new BulkWriteArgs
424
424
{
425
- WriteConcern = WriteConcern . Acknowledged ,
426
- IsOrdered = false ,
425
+ WriteConcern = WriteConcern . Acknowledged ,
426
+ IsOrdered = false ,
427
427
Requests = new WriteRequest [ ]
428
428
{
429
429
new UpdateRequest ( Query . EQ ( "x" , 1 ) , Update . Set ( "y" , 1 ) ) { IsUpsert = true } ,
@@ -493,7 +493,7 @@ public void TestCountWithQuery()
493
493
}
494
494
495
495
[ Test ]
496
- [ RequiresServer ( MinimumVersion = "2.6.0" ) ]
496
+ [ RequiresServer ( MinimumVersion = "2.6.0" ) ]
497
497
public void TestCountWithHint ( )
498
498
{
499
499
_collection . RemoveAll ( ) ;
@@ -602,6 +602,21 @@ public void TestCreateCollectionSetCappedSetMaxSize()
602
602
collection . Drop ( ) ;
603
603
}
604
604
605
+ [ Test ]
606
+ [ RequiresServer ( StorageEngines = "wiredtiger" ) ]
607
+ public void TestCreateCollectionSetStorageOptions ( )
608
+ {
609
+ var collection = _database . GetCollection ( "cappedcollection" ) ;
610
+ collection . Drop ( ) ;
611
+ Assert . IsFalse ( collection . Exists ( ) ) ;
612
+ var options = CollectionOptions . SetStorageOptions (
613
+ new BsonDocument ( "wiredtiger" , new BsonDocument ( "configString" , "block_compressor=zlib" ) ) ) ;
614
+ _database . CreateCollection ( collection . Name , options ) ;
615
+ Assert . IsTrue ( collection . Exists ( ) ) ;
616
+ var stats = collection . GetStats ( ) ;
617
+ collection . Drop ( ) ;
618
+ }
619
+
605
620
[ Test ]
606
621
public void TestCreateIndex ( )
607
622
{
@@ -677,6 +692,23 @@ public void TestCreateIndex()
677
692
}
678
693
}
679
694
695
+ [ Test ]
696
+ [ RequiresServer ( StorageEngines = "wiredtiger" ) ]
697
+ public void TestCreateIndexWithStorageOptions ( )
698
+ {
699
+ _collection . Drop ( ) ;
700
+ _collection . Insert ( new BsonDocument ( "x" , 1 ) ) ;
701
+ _collection . DropAllIndexes ( ) ; // doesn't drop the index on _id
702
+
703
+ _collection . CreateIndex (
704
+ IndexKeys . Ascending ( "x" ) ,
705
+ IndexOptions . SetStorageOptions (
706
+ new BsonDocument ( "wiredtiger" , new BsonDocument ( "configString" , "block_compressor=zlib" ) ) ) ) ;
707
+
708
+ var result = _collection . GetIndexes ( ) ;
709
+ Assert . AreEqual ( 2 , result . Count ) ;
710
+ }
711
+
680
712
[ Test ]
681
713
public void TestDistinct ( )
682
714
{
@@ -1758,9 +1790,9 @@ public void TestGeoSphericalIndex()
1758
1790
if ( _server . BuildInfo . Version >= new Version ( 2 , 4 , 0 ) )
1759
1791
{
1760
1792
if ( _collection . Exists ( ) ) { _collection . Drop ( ) ; }
1761
- _collection . Insert ( new PlaceGeoJson { Location = GeoJson . Point ( GeoJson . Geographic ( - 74.0 , 40.74 ) ) , Name = "10gen" , Type = "Office" } ) ;
1762
- _collection . Insert ( new PlaceGeoJson { Location = GeoJson . Point ( GeoJson . Geographic ( - 74.0 , 41.73 ) ) , Name = "Three" , Type = "Coffee" } ) ;
1763
- _collection . Insert ( new PlaceGeoJson { Location = GeoJson . Point ( GeoJson . Geographic ( - 75.0 , 40.74 ) ) , Name = "Two" , Type = "Coffee" } ) ;
1793
+ _collection . Insert ( new PlaceGeoJson { Location = GeoJson . Point ( GeoJson . Geographic ( - 74.0 , 40.74 ) ) , Name = "10gen" , Type = "Office" } ) ;
1794
+ _collection . Insert ( new PlaceGeoJson { Location = GeoJson . Point ( GeoJson . Geographic ( - 74.0 , 41.73 ) ) , Name = "Three" , Type = "Coffee" } ) ;
1795
+ _collection . Insert ( new PlaceGeoJson { Location = GeoJson . Point ( GeoJson . Geographic ( - 75.0 , 40.74 ) ) , Name = "Two" , Type = "Coffee" } ) ;
1764
1796
_collection . CreateIndex ( IndexKeys . GeoSpatialSpherical ( "Location" ) ) ;
1765
1797
1766
1798
// TODO: add Query builder support for 2dsphere queries
0 commit comments