我在MongoDB中有收藏:
{ "_id" : ObjectId("4d2407265ff08824e3000001"), "subida" : 3.95 }
{ "_id" : ObjectId("4d2551b4ae9fa739640df821"), "subida" : 6.03 }
{ "_id" : ObjectId("4d255b115ff08821c2000001"), "subida" : 5.53 }
{ "_id" : ObjectId("4d25e8d55ff08814f8000001"), "subida" : 1.96 }
Run Code Online (Sandbox Code Playgroud)
如何"subida"在所有文档中总结密钥的值?有了上面的文件,我应该收到以下内容:
{ "subida" : 17.47 }
Run Code Online (Sandbox Code Playgroud)