I was trying to achieve exactly what is described in Querying a child collection by multiple values in RavenDB, but when I try to implement it, I can't seem to the location of method Project and class Field as suggested in this snippet from that original question.
public class Products_ByCategoryIdAndSpecs_SortByTotalSold : AbstractIndexCreationTask<Product>
{
public Products_ByCategoryIdAndSpecs_SortByTotalSold()
{
this.Map = products => from product in products
select new
{
product.CategoryId,
_ = Project(product.Specs, spec => new Field("Spec_" + spec.Key, spec.Value, Field.Store.NO, Field.Index.ANALYZED)),
product.TotalSold
};
}
}
I am using unstable build 721 of RavenDB