> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
See group or mapreduce: http://www.mongodb.org/display/DOCS/Aggregation
On Mon, Mar 5, 2012 at 8:52 PM, Ram <ramesh...@gmail.com> wrote:
> I have a collection called tags with the documents in the below
> model.
> Each document has a tagname field and mrid field. The mrid field is an
> array.
>
>
> { "_id" : ObjectId("4f554c9ddc1def1a3a3ba62c"), "tagname" : "sql",
> "mrid" : [ "60", "59" ] }
> { "_id" : ObjectId("4f554c9edc1def1a3a3ba62d"), "tagname" : "java",
> "mrid" : [ "60" ] }
>
>
> I need query the list of tagnames along with the size of the array.
>
> the result should be like
>
> select tagname, count(mrid).
>
> result set: sql,2
> java,1
>
> How can I get this result?
>
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.