Does anyone have an example query for nested / internal objects in MongoDB using NORM (C #)? For example, if a typical document in the collection looks like Order / OrderItems, how can I find a specific OrderItem by OrderItem.Quantity> 10.
Having typed this from memory, I'm sorry if this is not so:
using ( var session = new MongoSession<Order>( DbName ) ) { var orders = session.Queryable .Where( o => o.OrderItems.Any( oi => oi.Quantity > 10 ) ) .ToList(); }
You need to create an additional βsizeβ of the field, which you increase when adding new elements and request it.
Source: https://habr.com/ru/post/1310793/More articles:JSPX namespaces not visible to EL functions? - xmlAre non-clustered indexes slowing down inserts? - database-indexesHow to make google-google app available on google? - google-app-engineSandbox "Sorry, your last action could not be completed" - paypalBinding a null value to a date field in pyobbc - pythonWhat is a good metaphor for c memory management? - cWhy do rails register an empty string? - loggingGet Base64 from imageURI using PhoneGap - androidWebGL packaging data: float64 / int64Arrays in Chrome - webkitYoutube videoconferences do not work - javascriptAll Articles