Let\'s say I have the following documents in collection:
{ \"family\": \"Smith\", \"children\": [ { \"child_name\": \"John\"
with the help aggregation framework:
db.collection.aggregate([{$unwind:'$children'}, {$group:{_id:'$children.child_name'}}])
or more interest ;) with frequency of name:
db.collection.aggregate([{$unwind:'$children'}, {$group:{_id:'$children.child_name', freq:{$sum:1}}}])