With this query, why did you return the data db.user.find (“_ id”: 101, “subhobbys.id”: 4}) of the embedded document?
This is the returned data structure:
{
"_id" : NumberLong(101),
"_class" : "com.xxoo.smart.domain.entity.User",
"age" : "31",
"friendNum" : 0,
"friendMessSwitch" : 1,
"teamMessSwitch" : 1,
"headUrl" : "http://7xll7k.com2.z0.glb.qiniucdn.com/jpg/1507a114a95icon_101_2015-10-18.jpg",
"career" : "",
"mobile" : "15801607348",
"nickname": "Lai Le",
"birthday" : "2015-1-1",
"horoscope": "Gemini",
"loginTime" : ISODate("2015-10-18T15:11:37.764Z"),
"sexCn": "Male",
"createTime" : ISODate("2015-10-18T02:30:44.869Z"),
"signKey" : "3843",
"signKeyTime" : ISODate("2015-10-18T02:30:44.869Z"),
"position" : {
"x" : 116.6661600000000050,
"y" : 40.3549369999999996
},
"easemobUserName" : "15801607348",
"easemobPassword" : "123456",
"cid" : "4eda857959a6ac32e69635575bf40244",
"teamNum" : 4,
"clientOs" : "ANDROID",
"clientOsVersion" : "1.0",
"channel" : "SportO2O",
"subHobbys" : [
{
"_id" : NumberLong(4),
"bigHobbyId" : 1,
"subHobbyName": "Badminton",
"subHobbyId" : NumberLong(4),
"levelType": "intermediate",
"level" : "3",
"sign" : "http://7xll7k.com2.z0.glb.qiniucdn.com/yumaoqiu.png" ,
"certFront" : "null",
"certBack" : "null",
"certStatus" : 0,
"hobbyType" : 1
},
{
"_id" : NumberLong(5),
"bigHobbyId" : 1,
"subHobbyName": "Ping Pong",
"subHobbyId" : NumberLong(5),
"levelType": "advanced",
"level" : "5",
"sign" : "http://7xll7k.com2.z0.glb.qiniucdn.com/pingpangqiu.png" ,
"certFront" : "null",
"certBack" : "null",
"certStatus" : 0,
"hobbyType" : 1
},
{
"_id" : NumberLong(16),
"bigHobbyId" : 1,
"subHobbyName": "Ice Hockey",
"subHobbyId" : NumberLong(16),
"levelType": "primary",
"level" : "2",
"sign" : "http://7xll7k.com2.z0.glb.qiniucdn.com/bingqiu.png" ,
"certFront" : "null",
"certBack" : "null",
"certStatus" : 0,
"hobbyType" : 2
},
{
"_id" : NumberLong(47),
"bigHobbyId" : 4,
"subHobbyName": "Bicycle",
"subHobbyId" : NumberLong(47),
"levelType": "intermediate",
"level" : "3",
"sign" : "http://7xll7k.com2.z0.glb.qiniucdn.com/zixingche.png" ,
"certFront" : "null",
"certBack" : "null",
"certStatus" : 0,
"hobbyType" : 1
},
{
"_id" : NumberLong(74),
"bigHobbyId" : 6,
"subHobbyName": "Sports Aircraft",
"subHobbyId" : NumberLong(74),
"levelType": "primary",
"level" : "1",
"sign" : "http://7xll7k.com2.z0.glb.qiniucdn.com/yundongfeiji.png" ,
"certFront" : "null",
"certBack" : "null",
"certStatus" : 0,
"hobbyType" : 1
},
{
"_id" : NumberLong(73),
"bigHobbyId" : 6,
"subHobbyName": "Motor Boat",
"subHobbyId" : NumberLong(73),
"levelType": "primary",
"level" : "2",
"sign" : "http://7xll7k.com2.z0.glb.qiniucdn.com/mototing.png" ,
"certFront" : "null",
"certBack" : "null",
"certStatus" : 0,
"hobbyType" : 1
}
],
"equipments" : [],
"comments" : [],
"friendIds" : [
NumberLong(102)
],
"provinceName": "Beijing",
"cityName": "beijing city",
"areaName": "Haidian District, Beijing",
"provinceId" : NumberLong(3318),
"cityId" : NumberLong(1),
"areaId" : NumberLong(7),
"teams" : [],
"teamIds" : [
NumberLong(120),
NumberLong(119),
NumberLong(117)
],
"fullName": "Haidian district, Beijing"
}
The conditions and documents have been sent out for a look, but they should not be matched.