I have a problem to build a filter for geting object by condition in nested array.
My models are:
public class ProductPriceInStore
{
[BsonId]
public ObjectId Id { get; set; }
public ObjectId store { get; set; }
public ObjectId product { get; set; }
public string measurementUnit { get; set; }
public IList<ProductPrices> prices { get; set; }
}
public class ProductPrices
{
public double? actualPrice { get; set; }
public double? originalPrice { get; set; }
}
What I want to do is find all ProductPriceInStore, which contains ProductPrice with actualPrice greater than originalPrice
I'm using nugget MongoDB.Driver 2.7.3 in my project