We have collection with documents like:
{
"_id" : <ObjectId>,
"player" : <String>,
"params" : [
...,
{
"name" : "kills",
"value" : 10
},
{
"name" : "deaths",
"value" : 10
},
{
"name" : "assists",
"value" : 10
},
...
]
}
Is there any way to get list of all players with calculated KDA? KDA=(kills+assists)/deaths
For example, like this:
[{
"_id" : <ObjectId>,
"player" : <String>,
"kda" : 2.5
},
...
]
And how to execute queries on resulted collection? To find all players with KDA>10 etc. Thanks!