Hi @nuno thanks for your reply. I admit I don’t know to much about fragments, but I can’t see how that would help in retrieving the exact comment just created
Instead of querying all scalar fields of a model (which is the default behavior), you can specify which fields you'd like retrieve by using the $fragment
In the scenario described above I just inserted a new comment in a list of comments as an embedded document inside a post(mongodb driver).
I will receive back the entire Post with all its fields, I understand
$fragment might avoid to return everything back, but it doesn’t solve the problem of how to get back the comment you just created without having to filter the comments list.
The biggest problem is that two comments could be identical, so filtering by the fields is not ideal.
I don’t know the ID.
So perhaps the only way is to filter by the most recent comment.