假设存储在ScriptDb中的对象 schema :
{name: 'alice',
age: 12,
interests: [
{interest: 'tea parties', enthusiasm: 'high'},
{interest: 'croquet', enthusiasm: 'moderate'},
]
}
我了解如何查询前两个属性但不知道如何运行查询以返回所有行 interests[enthusiasm = moderate]
从字面上看这个例子并尝试:db.query({interests:[{enthusiasm: 'moderate'}]});
返回 ScriptDbResult ,但任何尝试使用该结果的方法都会导致错误:
Queries can only contain letters, numbers, spaces, dashes and underscores as keys.
答案 0 :(得分:2)
目前无法实现。它可能会在将来的更新中得到支持。你现在能做的最好的事情就是加载所有兴趣并自己循环遍历它们。