[QUESTION] Include Functionality For Nested Object , like v4 Includeall ?
See original GitHub issueI am stuck on finding solution for below query. using litedb v5
Query : db.GetCollection<PurchaseOrder().Include(x=>x.OrderItems)
, want to include Model
DTOs :
public class PurchaseOrder
{
public int Id { get; set; }
public DateTime DatePurchased { get; set; }
public List<OrderDetail> OrderItems { get; set; }
public string Note { get; set; }
}
public class OrderDetail
{
public Model Model { get; set; }
public decimal Price { get; set; }
public int Qty { get; set; }
}
public class Model
{
public int Id { get; set; }
public string Name { get; set; }
}
Issue : when i run above query it gives me result but Model is is always null. Any help will be appreciated !!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Nested include in sequelize?
This solution does not work as written (at least not in the version I have, 3.24.1). The inner include should be 'include: [models.users]'....
Read more >Working with nested arrays
I have a nested json that I'm using the Arrays function under data manipulation to pull out information using Find All.
Read more >Nested field type | Elasticsearch Guide [8.9]
The nested type is a specialised version of the object data type that allows arrays of objects to be indexed in a way...
Read more >Persistent Object Systems 7 (POS-7) - Page 165 - Google Books Result
Also , for each attribute , the extent table includes information used to ... features of the nested relational and complex object data...
Read more >top-nested operator - Azure Data Explorer
The top-nested operator performs hierarchical aggregation and value selection. Imagine you have a table with sales information like regions, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
db.GetCollection<PurchaseOrder>().Include("$.OrderItems[*].Model")
Thanks !! It works. Is there any way to define IncludeAll ? without explicitly specifying each dbRef ?totally missed the fact that
OrderItems
was a list and that, probablyOrderItems
isn´tBsonRef
ed 🙄assuming only
Model
is declared asBsonRef
, how aboutdb.GetCollection<PurchaseOrder>().Include("$.OrderItems[*].Model");
?