Mongodb Meteor轻松搜索用户集合中的嵌套字段
我在users集合中有嵌套属性,例如:“users.cast.eyes” 如何使用easy search selector方面搜索这些内容Mongodb Meteor轻松搜索用户集合中的嵌套字段,mongodb,meteor,selector,Mongodb,Meteor,Selector,我在users集合中有嵌套属性,例如:“users.cast.eyes” 如何使用easy search selector方面搜索这些内容 /*This is not working, because "eyes" is a nested property*/ if (options.search.props.eyes) { selector.eyes = options.search.props.eyes; } /*This is not working, I'm getting a n
/*This is not working, because "eyes" is a nested property*/
if (options.search.props.eyes) {
selector.eyes = options.search.props.eyes;
}
/*This is not working, I'm getting a not such property error*/
if (options.search.props.eyes) {
selector.cast.eyes = options.search.props.eyes;
}
非常感谢您的帮助,谢谢您自己已经回答了。使用基于字符串的属性查询嵌套对象:
selector['cast.eyes']=。。。
你自己已经回答了。使用基于字符串的属性查询嵌套对象:
selector['cast.eyes']=。。。
使用MongoDB,您可以使用点符号查询文档的嵌套文件,使用MongoDB查看,您可以使用点符号查询文档的嵌套文件,查看