插入 测试数据

for(var j=1;j<3;j++){    
for(var i=1;i<3;i++){    
  var person={
    Name:"jack"+i,
    Age:i,
    Address:["henan","wuhan"],
    Course:[
    {Name:"shuxue",Score:i},
    {Name:"wuli",Score:i}
    ]
  }
  db.DemoTest.Person.insert(person)     
}
}

 

Count

db.DemoTest.Person.count({Name:"jack1"})

返回数量

 

 distinct

db.DemoTest.Person.distinct("Name")

返回不重复的Name值。

 

 group

例子:按照Name分组,条件是Age大于46

db.DemoTest.Person.group({
    "key":{"Name":true}, -----分组的keky
    "initial":{"Person":[]},-------每组分享的一个”初始化函数“
    "$reduce":function(cur,prev){   ------这个函数的第一个参数是当前的文档对象,第二个参数是上一次function操作的累计对象,第一次为initial中的{”person“:[]}。有多少个文档, $reduce就会调用多少次

prev.Person.push(cur);
},
    "finalize":function(prev){   ---返回每组的数量     
      prev.count=prev.Person.length;  
    },
    "condition":{"Age":{"$lt":46}}   -----过滤条件
    })

返回结果如下:

/* 0 */
{
    "0" : {
        "Name" : "jack1",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9d6"),
                "Name" : "jack1",
                "Age" : 1,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 1
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 1
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba07"),
                "Name" : "jack1",
                "Age" : 1,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 1
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 1
                    }
                ]
            }
        ],
        "count" : 2
    },
    "1" : {
        "Name" : "jack2",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9d7"),
                "Name" : "jack2",
                "Age" : 2,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 2
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 2
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba08"),
                "Name" : "jack2",
                "Age" : 2,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 2
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 2
                    }
                ]
            }
        ],
        "count" : 2
    },
    "2" : {
        "Name" : "jack3",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9d8"),
                "Name" : "jack3",
                "Age" : 3,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 3
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 3
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba09"),
                "Name" : "jack3",
                "Age" : 3,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 3
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 3
                    }
                ]
            }
        ],
        "count" : 2
    },
    "3" : {
        "Name" : "jack4",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9d9"),
                "Name" : "jack4",
                "Age" : 4,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 4
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 4
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba0a"),
                "Name" : "jack4",
                "Age" : 4,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 4
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 4
                    }
                ]
            }
        ],
        "count" : 2
    },
    "4" : {
        "Name" : "jack5",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9da"),
                "Name" : "jack5",
                "Age" : 5,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 5
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 5
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba0b"),
                "Name" : "jack5",
                "Age" : 5,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 5
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 5
                    }
                ]
            }
        ],
        "count" : 2
    },
    "5" : {
        "Name" : "jack6",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9db"),
                "Name" : "jack6",
                "Age" : 6,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 6
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 6
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba0c"),
                "Name" : "jack6",
                "Age" : 6,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 6
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 6
                    }
                ]
            }
        ],
        "count" : 2
    },
    "6" : {
        "Name" : "jack7",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9dc"),
                "Name" : "jack7",
                "Age" : 7,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 7
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 7
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba0d"),
                "Name" : "jack7",
                "Age" : 7,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 7
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 7
                    }
                ]
            }
        ],
        "count" : 2
    },
    "7" : {
        "Name" : "jack8",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9dd"),
                "Name" : "jack8",
                "Age" : 8,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 8
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 8
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba0e"),
                "Name" : "jack8",
                "Age" : 8,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 8
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 8
                    }
                ]
            }
        ],
        "count" : 2
    },
    "8" : {
        "Name" : "jack9",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9de"),
                "Name" : "jack9",
                "Age" : 9,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 9
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 9
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba0f"),
                "Name" : "jack9",
                "Age" : 9,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 9
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 9
                    }
                ]
            }
        ],
        "count" : 2
    },
    "9" : {
        "Name" : "jack10",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9df"),
                "Name" : "jack10",
                "Age" : 10,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 10
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 10
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba10"),
                "Name" : "jack10",
                "Age" : 10,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 10
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 10
                    }
                ]
            }
        ],
        "count" : 2
    },
    "10" : {
        "Name" : "jack11",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e0"),
                "Name" : "jack11",
                "Age" : 11,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 11
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 11
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba11"),
                "Name" : "jack11",
                "Age" : 11,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 11
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 11
                    }
                ]
            }
        ],
        "count" : 2
    },
    "11" : {
        "Name" : "jack12",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e1"),
                "Name" : "jack12",
                "Age" : 12,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 12
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 12
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba12"),
                "Name" : "jack12",
                "Age" : 12,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 12
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 12
                    }
                ]
            }
        ],
        "count" : 2
    },
    "12" : {
        "Name" : "jack13",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e2"),
                "Name" : "jack13",
                "Age" : 13,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 13
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 13
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba13"),
                "Name" : "jack13",
                "Age" : 13,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 13
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 13
                    }
                ]
            }
        ],
        "count" : 2
    },
    "13" : {
        "Name" : "jack14",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e3"),
                "Name" : "jack14",
                "Age" : 14,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 14
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 14
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba14"),
                "Name" : "jack14",
                "Age" : 14,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 14
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 14
                    }
                ]
            }
        ],
        "count" : 2
    },
    "14" : {
        "Name" : "jack15",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e4"),
                "Name" : "jack15",
                "Age" : 15,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 15
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 15
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba15"),
                "Name" : "jack15",
                "Age" : 15,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 15
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 15
                    }
                ]
            }
        ],
        "count" : 2
    },
    "15" : {
        "Name" : "jack16",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e5"),
                "Name" : "jack16",
                "Age" : 16,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 16
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 16
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba16"),
                "Name" : "jack16",
                "Age" : 16,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 16
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 16
                    }
                ]
            }
        ],
        "count" : 2
    },
    "16" : {
        "Name" : "jack17",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e6"),
                "Name" : "jack17",
                "Age" : 17,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 17
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 17
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba17"),
                "Name" : "jack17",
                "Age" : 17,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 17
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 17
                    }
                ]
            }
        ],
        "count" : 2
    },
    "17" : {
        "Name" : "jack18",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e7"),
                "Name" : "jack18",
                "Age" : 18,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 18
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 18
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba18"),
                "Name" : "jack18",
                "Age" : 18,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 18
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 18
                    }
                ]
            }
        ],
        "count" : 2
    },
    "18" : {
        "Name" : "jack19",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e8"),
                "Name" : "jack19",
                "Age" : 19,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 19
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 19
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba19"),
                "Name" : "jack19",
                "Age" : 19,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 19
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 19
                    }
                ]
            }
        ],
        "count" : 2
    },
    "19" : {
        "Name" : "jack20",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9e9"),
                "Name" : "jack20",
                "Age" : 20,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 20
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 20
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba1a"),
                "Name" : "jack20",
                "Age" : 20,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 20
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 20
                    }
                ]
            }
        ],
        "count" : 2
    },
    "20" : {
        "Name" : "jack21",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9ea"),
                "Name" : "jack21",
                "Age" : 21,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 21
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 21
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba1b"),
                "Name" : "jack21",
                "Age" : 21,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 21
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 21
                    }
                ]
            }
        ],
        "count" : 2
    },
    "21" : {
        "Name" : "jack22",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9eb"),
                "Name" : "jack22",
                "Age" : 22,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 22
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 22
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba1c"),
                "Name" : "jack22",
                "Age" : 22,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 22
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 22
                    }
                ]
            }
        ],
        "count" : 2
    },
    "22" : {
        "Name" : "jack23",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9ec"),
                "Name" : "jack23",
                "Age" : 23,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 23
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 23
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba1d"),
                "Name" : "jack23",
                "Age" : 23,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 23
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 23
                    }
                ]
            }
        ],
        "count" : 2
    },
    "23" : {
        "Name" : "jack24",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9ed"),
                "Name" : "jack24",
                "Age" : 24,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 24
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 24
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba1e"),
                "Name" : "jack24",
                "Age" : 24,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 24
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 24
                    }
                ]
            }
        ],
        "count" : 2
    },
    "24" : {
        "Name" : "jack25",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9ee"),
                "Name" : "jack25",
                "Age" : 25,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 25
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 25
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba1f"),
                "Name" : "jack25",
                "Age" : 25,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 25
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 25
                    }
                ]
            }
        ],
        "count" : 2
    },
    "25" : {
        "Name" : "jack26",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9ef"),
                "Name" : "jack26",
                "Age" : 26,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 26
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 26
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba20"),
                "Name" : "jack26",
                "Age" : 26,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 26
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 26
                    }
                ]
            }
        ],
        "count" : 2
    },
    "26" : {
        "Name" : "jack27",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f0"),
                "Name" : "jack27",
                "Age" : 27,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 27
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 27
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba21"),
                "Name" : "jack27",
                "Age" : 27,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 27
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 27
                    }
                ]
            }
        ],
        "count" : 2
    },
    "27" : {
        "Name" : "jack28",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f1"),
                "Name" : "jack28",
                "Age" : 28,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 28
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 28
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba22"),
                "Name" : "jack28",
                "Age" : 28,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 28
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 28
                    }
                ]
            }
        ],
        "count" : 2
    },
    "28" : {
        "Name" : "jack29",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f2"),
                "Name" : "jack29",
                "Age" : 29,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 29
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 29
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba23"),
                "Name" : "jack29",
                "Age" : 29,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 29
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 29
                    }
                ]
            }
        ],
        "count" : 2
    },
    "29" : {
        "Name" : "jack30",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f3"),
                "Name" : "jack30",
                "Age" : 30,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 30
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 30
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba24"),
                "Name" : "jack30",
                "Age" : 30,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 30
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 30
                    }
                ]
            }
        ],
        "count" : 2
    },
    "30" : {
        "Name" : "jack31",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f4"),
                "Name" : "jack31",
                "Age" : 31,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 31
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 31
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba25"),
                "Name" : "jack31",
                "Age" : 31,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 31
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 31
                    }
                ]
            }
        ],
        "count" : 2
    },
    "31" : {
        "Name" : "jack32",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f5"),
                "Name" : "jack32",
                "Age" : 32,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 32
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 32
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba26"),
                "Name" : "jack32",
                "Age" : 32,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 32
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 32
                    }
                ]
            }
        ],
        "count" : 2
    },
    "32" : {
        "Name" : "jack33",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f6"),
                "Name" : "jack33",
                "Age" : 33,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 33
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 33
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba27"),
                "Name" : "jack33",
                "Age" : 33,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 33
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 33
                    }
                ]
            }
        ],
        "count" : 2
    },
    "33" : {
        "Name" : "jack34",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f7"),
                "Name" : "jack34",
                "Age" : 34,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 34
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 34
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba28"),
                "Name" : "jack34",
                "Age" : 34,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 34
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 34
                    }
                ]
            }
        ],
        "count" : 2
    },
    "34" : {
        "Name" : "jack35",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f8"),
                "Name" : "jack35",
                "Age" : 35,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 35
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 35
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba29"),
                "Name" : "jack35",
                "Age" : 35,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 35
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 35
                    }
                ]
            }
        ],
        "count" : 2
    },
    "35" : {
        "Name" : "jack36",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9f9"),
                "Name" : "jack36",
                "Age" : 36,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 36
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 36
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba2a"),
                "Name" : "jack36",
                "Age" : 36,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 36
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 36
                    }
                ]
            }
        ],
        "count" : 2
    },
    "36" : {
        "Name" : "jack37",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9fa"),
                "Name" : "jack37",
                "Age" : 37,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 37
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 37
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba2b"),
                "Name" : "jack37",
                "Age" : 37,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 37
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 37
                    }
                ]
            }
        ],
        "count" : 2
    },
    "37" : {
        "Name" : "jack38",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9fb"),
                "Name" : "jack38",
                "Age" : 38,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 38
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 38
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba2c"),
                "Name" : "jack38",
                "Age" : 38,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 38
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 38
                    }
                ]
            }
        ],
        "count" : 2
    },
    "38" : {
        "Name" : "jack39",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9fc"),
                "Name" : "jack39",
                "Age" : 39,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 39
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 39
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba2d"),
                "Name" : "jack39",
                "Age" : 39,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 39
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 39
                    }
                ]
            }
        ],
        "count" : 2
    },
    "39" : {
        "Name" : "jack40",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9fd"),
                "Name" : "jack40",
                "Age" : 40,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 40
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 40
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba2e"),
                "Name" : "jack40",
                "Age" : 40,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 40
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 40
                    }
                ]
            }
        ],
        "count" : 2
    },
    "40" : {
        "Name" : "jack41",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9fe"),
                "Name" : "jack41",
                "Age" : 41,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 41
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 41
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba2f"),
                "Name" : "jack41",
                "Age" : 41,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 41
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 41
                    }
                ]
            }
        ],
        "count" : 2
    },
    "41" : {
        "Name" : "jack42",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2b9ff"),
                "Name" : "jack42",
                "Age" : 42,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 42
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 42
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba30"),
                "Name" : "jack42",
                "Age" : 42,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 42
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 42
                    }
                ]
            }
        ],
        "count" : 2
    },
    "42" : {
        "Name" : "jack43",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba00"),
                "Name" : "jack43",
                "Age" : 43,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 43
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 43
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba31"),
                "Name" : "jack43",
                "Age" : 43,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 43
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 43
                    }
                ]
            }
        ],
        "count" : 2
    },
    "43" : {
        "Name" : "jack44",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba01"),
                "Name" : "jack44",
                "Age" : 44,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 44
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 44
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba32"),
                "Name" : "jack44",
                "Age" : 44,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 44
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 44
                    }
                ]
            }
        ],
        "count" : 2
    },
    "44" : {
        "Name" : "jack45",
        "Person" : [ 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba02"),
                "Name" : "jack45",
                "Age" : 45,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 45
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 45
                    }
                ]
            }, 
            {
                "_id" : ObjectId("54461dce69f872cf5ea2ba33"),
                "Name" : "jack45",
                "Age" : 45,
                "Address" : [ 
                    "henan", 
                    "wuhan"
                ],
                "Course" : [ 
                    {
                        "Name" : "shuxue",
                        "Score" : 45
                    }, 
                    {
                        "Name" : "wuli",
                        "Score" : 45
                    }
                ]
            }
        ],
        "count" : 2
    }
}
返回的json

相关文章: