carlveeOriginal post
Flutter Developer
if say I have a response that looked like this
{ "level 1" : "level 1",
"level 2" : [
{
"name" : "example name",
"$id" : "32n1jnabsjdf",
"level 3" : [
{
"name": "name",
"$id":"id",
createdAt..., updatedAt..., other...
}
]
createdAt..., updatedAt..., other...
}
]
Is there a way I can query it so it ONLY returns the level 2's name and id, also level 3's name and id, for example when I call getDocuments or listDocuments?
Summary
The developers can achieve this by using the MongoDB projection feature. They need to write a projection query specifying the fields they want to include in the response. For this case, they can include only "level 2.name", "level 2.$id", "level 2.level 3.name", and "level 2.level 3.$id" in the projection query to retrieve only those specific fields in the response.