-
Type:
Improvement
-
Resolution: Won't Fix
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.0, 2.1
-
Component/s: API
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
This is a request for a 'HasIndex(string indexName)' or 'ContainsIndex(string indexName)' helper.
Unless I'm missing something, to find out if an index exists on a collection, one must:
var query = await myCollection.Indexes.ListAsync();
var bsonIndexes = await query.ToListAsync();
var indexNames = bsonIndexes .Select(i => i.Values); // or some variation
return indexNames.Contains("blah");