【发布时间】:2017-08-14 22:36:35
【问题描述】:
我一直在查看文档,但似乎无法弄清楚如何为 buildfire.datastore.search 查询正确创建 filter 对象。
我的对象上有一个 address 属性,我希望能够输入部分地址并让它返回。以下是我尝试传递给搜索查询的过滤器对象:
search = {filter: {"$json.address": {"$regex": `/${this.state.search}/`}}};
search = {filter: {'$regex': {'$json.address': this.state.search}}};
两者都没有奏效。最终目标是:
buildfire.datastore.search(search, 'location', cb);
编辑:
我什至尝试在文档中硬编码正则表达式:
"$or" : [
{"description": {"$regex":"/new /"}}
]
但它不起作用(我用我知道会显示的字符串替换了“新”)。
【问题讨论】:
标签: buildfire