Open truemetal opened 7 years ago
Node
doesn't have an identifier
type so I don't think it's possible to do through the Fluent API currently.
We'd need to decide on some method for signaling an object id (perhaps oid:
before the string?)
As a workaround, you can do (database.driver as? MongoDriver)?.raw(...)
Most Mongo commands use $something
as object keys to separate them from JSON data. I think it would be a clean strategy for the driver to do the same, and @truemetal's example code (from "This code:") should work automatically.
@vzsg that seems like a great solution
I have a sample application where a ShoppingList model has many Item objects. When I create an Item with the shopping_list_id, then the shopping list model is not able to query to fetch all items that it owns. Here is the repo which has the code https://github.com/ankurp/ShoppingListServer
Does Mongo Provider support parent child relation and is it able to query all children from the database?
This is more of a question with a potential of becoming a feature request.
This code:
Produces this:
This code:
Produces this:
But how do I achieve this?