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.
share|improve this question

60% accept rate
feedback

1 Answer

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.

share|improve this answer
Corey, do you advise that open an enhancement request regarding this? – Henrique Abreu 19 hours ago
Sure why not :-) – Corey G 14 hours ago
thanks Henrique - beat me to it – Jonathon 2 hours ago
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.