How can i calculate price positive and negative price using mongodb or robomongo?
问题 below is my userpricing collection data { "_id" : ObjectId("584bc9ba420a6b189c510af6"), "user_id" : 1, "mobilenumber":"01234", "price" : 2000.0, "type" : "credit", }, { "_id" : ObjectId("584bc9ba420a6b189c510af6"), "user_id" : 1, "mobilenumber":"01234", "price" : -1000.0, "type" : "credit", }, { "_id" : ObjectId("584bc9ba420a6b189c3323w23"), "user_id" : 2, "mobilenumber":"04321", "price" : 1000.0, "type" : "credit", } here i want to calculate total postive and total negative price of all user