I want to create a text index for multiple fields and fields of elements in an array. Currently I define the path to the array elements as a string, which works. Is there a way to use an expression just like I can do for simple fields like this:
var textIndex = Builders<Project>.IndexKeys
.Text(p => p.Name)
.Text(p => p.Description)
// This and any other expression I tried does not work
//.Text(p => p.System.Elements.SelectMany(e => e.Name))
// But this works fine:
.Text("system.elements.name");
await collection.Indexes.CreateOneAsync(textIndex);
I'm using mongodb 3.2 and MongoDB.Driver 2.2.2