Closed thiagotsn closed 1 year ago
Thanks for this. Could you please provide more info on where you are using this feature? It could be on a specific field in the documents view or on a column?
Initially I was mentioning the document view. But I just checked with column and it also happens. I just have the issue if it's a field inside an array. I drill down one element of the array and select a field. From there, I try to group by and count for All documents...
OK thanks, will correct it. I see your issue now. Can you send a small example of your doc? Or just a part of it and what you select do group-by-count? Is it an array of strings (or other primitive values) or an array of objects?
Can you send a small example of the doc / array? Is it an array of primitive values (strings, numbers, etc...) or an array of objects?
It's an array of objects. If I select any primitive type inside the object it'll display the values above.
{
"item": [
{
"id": "12345",
"customer": "JOHN DOE",
"product": {
"name": "Product Test",
"type": "BOOK"
},
"quantity": 1
},
{
"id": "54321",
"customer": "JANE DOE",
"product": {
"name": "Product Test 2",
"type": "PEN"
},
"quantity": 1
},
]
}
Thanks. And would you like to group/count the values within the selected document only (so within that array) or within all arrays in all documents of the collection?
I was expecting to group and count all documents in the collection
This now works both on arrays of primitive values and on nested arrays of objects. So you can now groupby and count on something like this for example: photos.0.title (will groupby / count all title in all photos)
This has been resolved in the latest RC release, please check it out and let us know if the solution works as expected:
It's working now. I just tested it. Thanks!
When trying to use the Group by and count feature for an array record, it's aggregating all records in an empty string. Example: