[CSHARP-962] IndexOptions builder doesn't support 'bits' option for 2d indexes Created: 28/Apr/14  Updated: 02/Apr/15  Resolved: 02/May/14

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.9.1

Type: Improvement Priority: Minor - P4
Reporter: Kamran K. Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I don't seem to see support for the 'bits' option for 2d indexes in the IndexOptions class.

Docs: http://docs.mongodb.org/manual/tutorial/build-a-2d-index/


Version: 064bdfa47ecc4284260d17b89c92cff60426b79a



 Comments   
Comment by Githook User [ 02/May/14 ]

Author:

{u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-962: Add SetBits to IndexOptionsBuilder.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/40c7970dc658a47c2ba43198aadb1ee0ac6d5461

Comment by Githook User [ 02/May/14 ]

Author:

{u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-962: Add SetBits to IndexOptionsBuilder.
Branch: v1.x
https://github.com/mongodb/mongo-csharp-driver/commit/0b6f3ab0393968574fa9fbf6a7eddd00a69c08da

Comment by Craig Wilson [ 28/Apr/14 ]

It looks like we haven't implemented that in the typed builders.

To workaround this, you can use the IndexOptionsDocument directly.

var keys = IndexKeys.GeoSpatial("loc");
var options = new IndexOptionsDocument { { "bits", 32 } };
collection.CreateIndex(keys, options);

Generated at Wed Feb 07 21:38:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.