Home > database >  Mongo aggregation operations on a particular field, but the field is a string type, how should solve
Mongo aggregation operations on a particular field, but the field is a string type, how should solve

Time:10-15

As title, directing aggregation operations on a particular field, but the field is a string type, how should solve? Can't modify the data, bosses solutions,

CodePudding user response:

Do the aggregation? Use the map - it should not be difficult to reduce

CodePudding user response:

Is to calculate the mean maximum and minimum values of each field, but they are all type string, if read data with code in action is too slow, for any more efficiency method?

CodePudding user response:

When the project the convert know about the
 
"Value" : {
"$convert" : {
"Input" : "$answerItem. V",
"To", "double",
"OnError" : 0,
"OnNull" : 0
}
}
  • Related