-
Type:
Bug
-
Resolution: Done
-
Priority:
Critical - P2
-
None
-
Affects Version/s: 1.4.2
-
Component/s: None
-
Environment:Win7 / 64 bit (Virtual Box)
-
Minor Change
Creating an index in like so works fine:
var collection=database.CreateCollection("Categories");
var category = database.GetCollection("Categories");
var keys = IndexKeys.Ascending("Name");
var sort = SortBy.Ascending("Name");
database.GetCollection("Categories").CreateIndex(keys, IndexOptions.SetUnique(true).SetDropDups(false));
But creating an index like so (define the options before the CreateIndex throws an unhandled exception in many situations):
var collection=database.CreateCollection("Categories");
var category = database.GetCollection("Categories");
var keys = IndexKeys.Ascending("Name");
var sort = SortBy.Ascending("Name");
var options = IndexOptions.SetUnique(true).SetDropDups(false);
database.GetCollection("Categories").CreateIndex(keys,options);