Assume an object schema stored in ScriptDb:
{name: 'alice',
age: 12,
interests: [
{interest: 'tea parties', enthusiasm: 'high'},
{interest: 'croquet', enthusiasm: 'moderate'},
]
}
I understand how to query against the first two attributes but not how to run a query to return all rows where interests[enthusiasm = moderate]
Taking that example literally and trying: db.query({interests:[{enthusiasm: 'moderate'}]});
returns a ScriptDbResult but any attempt to use that result's methods results in an error:
Queries can only contain letters, numbers, spaces, dashes and underscores as keys.
This is not currently possible. It may be supported in a future update. The best you can do now is load all interests and loop through them yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With