Is this possible to make a query like that in MongoDB?
SELECT `pro` , COUNT( * ) , SUM( `age` )
FROM `k_pin`
GROUP BY `pro
If yes, how? PHP example would be perfect.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The mongoDB call would be as follows:
Which can all be found here: http://www.mongodb.org/display/DOCS/SQL+to+Aggregation+Framework+Mapping+Chart
I will leave the php up to you, since that is the easy part.