Hello,
I’m using this view
db.createView("filestatistic", "file", [{
"$facet": {
"byte_size": [{
"$group": {
"_id": null,
"max": {"$max": "$byte_size"},
"min": {"$min": "$byte_size"},
"avg": {"$avg": "$byte_size"},
}
}],
"width": [{
"$group": {
"_id": null,
"max": {"$max": "$image.width"},
"min": {"$min": "$image.width"},
"avg": {"$avg": "$image.width"},
}
}],
"height": [{
"$group": {
"_id": null,
"max": {"$max": "$image.height"},
"min": {"$min": "$image.height"},
"avg": {"$avg": "$image.height"},
}
}],
"mediatypes": [{
"$group": {
"_id": "$media_type"
}
}]
}
}])
The result JSON (which is used for a service) is
{
"byte_size": [
{
"_id": null,
"max": 171763,
"min": 127114,
"avg": 152524.0
}
],
"width": [
{
"_id": null,
"max": 794,
"min": 794,
"avg": 794.0
}
],
"height": [
{
"_id": null,
"max": 1123,
"min": 1123,
"avg": 1123.0
}
],
"mediatypes": [
{
"_id": "image/jpeg"
}
]
}
Is it possible to change the query, so that I get e.g.
"height: {
"max":
"min":
"avg":
}
So I would like to remove the list and I don’t know how.
Thanks a lot