node.js - mongodb查找子对象的名称为某个值的对象的方法
ringa_lee
ringa_lee 2017-04-17 15:26:49
0
1
485

如图,我建立了一个action表,想查找里面子对象joinObj的子对象id为1000的action对象。大概知道是使用type方法查询,具体应该怎么做呢?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
洪涛

I don’t quite understand whether 1000 refers to the sub-object called 1000, or userID=1000?
If it is the former, there is no way to write it. If it’s the latter, there should be

db.actions.find({"joinObj.1000.userID": 1000})

Please clarify the issue before we can continue the discussion.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template