The query of mongodb in the following scenario …

  mongodb, question

The data pattern is as follows. How to use mapReduce to count the number of children whose sex is male? (Children’s Life Unknown, Data Structure Touching! _! )
There are about millions of such data in a db set.

{
 "name": "Little Lean Oil to Rikuban",
 "Xiao Xin": {"
 "Name": "Xiao Xin",
 "Age": "6",
 "Gender": "Male"
 },
 "Nini": {"
 "Name": "Nini",
 "Age": "7",
 "Gender": "Female"
 },
 "Hazama jade": {"
 "Name": "Hazama jade",
 "Age": "7",
 "Gender": "Male"
 },
 "A Dai": {"
 "Name": "A Dai",
 "Age": "6",
 "Gender": "Male"
 },
 .
 .
 .
 .
 .
 
 
 }

For this data structure, MapReduce is used for statistics. I wonder if the landlord has found a solution yet? First of all, it is impossible to determine how many images a record has.

"A Dai": {"
 "Name": "A Dai",
 "Age": "6",
 "Gender": "Male"
 }

This kind of data, and map key you are not fixed, so it is difficult to locate the gender field. The realization I can think of is to do statistics in the program, that is, to take them out of the database. If the landlord has implemented MapReduce statistics, I hope to share the implementation, thank you.