比方說,我有一個像下面這樣的數據集:最快的方式來獲得一個特定領域的平均MongoDB中
{ "_id" : ObjectId("4dd51c0a3f42cc01ab0e6506"), "views" : 1000, "status" : 1 }
{ "_id" : ObjectId("4dd51c0e3f42cc01ab0e6507"), "views" : 2000, "status" : 1 }
{ "_id" : ObjectId("4dd51c113f42cc01ab0e6508"), "views" : 3000, "status" : 1 }
{ "_id" : ObjectId("4dd51c113f42cc01ab0e6508"), "views" : 4000, "status" : 0 }
什麼是最快的方式(性能明智)獲得的意見的平均數所有狀態爲1的文件?對於像這樣基本的東西需要Map/Reduce還是有其他方法?
只是想知道爲什麼減號?我的回答有什麼問題? –