@@ -607,11 +607,13 @@ test_index_geo (void)
607
607
geo_opt .twod_bits_precision = 30 ;
608
608
opt .geo_options = & geo_opt ;
609
609
610
- r = mongoc_collection_create_index (collection , & keys , & opt , & error );
611
- ASSERT (r );
610
+ if (client -> cluster .nodes [0 ].max_wire_version > 0 ) {
611
+ r = mongoc_collection_create_index (collection , & keys , & opt , & error );
612
+ ASSERT (r );
612
613
613
- r = mongoc_collection_drop_index (collection , "location_2d" , & error );
614
- ASSERT (r );
614
+ r = mongoc_collection_drop_index (collection , "location_2d" , & error );
615
+ ASSERT (r );
616
+ }
615
617
616
618
/* Create a Haystack index */
617
619
bson_init (& keys );
@@ -622,11 +624,13 @@ test_index_geo (void)
622
624
geo_opt .haystack_bucket_size = 5 ;
623
625
opt .geo_options = & geo_opt ;
624
626
625
- r = mongoc_collection_create_index (collection , & keys , & opt , & error );
626
- ASSERT (r );
627
+ if (client -> cluster .nodes [0 ].max_wire_version > 0 ) {
628
+ r = mongoc_collection_create_index (collection , & keys , & opt , & error );
629
+ ASSERT (r );
627
630
628
- r = mongoc_collection_drop_index (collection , "location_geoHaystack_category_1" , & error );
629
- ASSERT (r );
631
+ r = mongoc_collection_drop_index (collection , "location_geoHaystack_category_1" , & error );
632
+ ASSERT (r );
633
+ }
630
634
631
635
mongoc_collection_destroy (collection );
632
636
mongoc_database_destroy (database );
0 commit comments