Hello I have one question about indexing array in subquery, in where condition. Basicly I want just first element of array Array in where condition.
"SELECT META().id FROM database
WHERE ANY object in Objects
SATISFIES (object.isObject = false OR object.finalObject.isObject = false) END AND (Type = \'type\')"
There can be lot of Objects in array but i need just that first one.
Is that possible in couchbaselite 3.0 ?
Thanks for answers.
EDIT: I want replace WHERE ANY with WHERE FIRST. But I don’t know if its possible
@RomYk97 Does adding the clause “LIMIT 1” satisfy your need?
Hello, no I need all MainObjects which has array with another objects [Objects] and i need to compare just first element of this property. But MainObjects can be more than 1
Do you have a real example? I don’t see where “Objects” comes from. META().id is a string. Could you please clarify? If you have a similar query that works in current version and suggest improvement in specific places, that would be greatly helpful.
Did you try that
WHERE (Objects.isObject = false OR Objects.finalObject.isObject = false) AND (Type = 'type')
@RomYk97, are you saying that query is not working when Objects itself is an array? If so, I will file a bug, because the current grammar allows it.
With regard to your suggestion of WHERE FIRST, does @vsr1’s suggestion fit your need?
Hello, I did workaround through subObject oredrNumber but didnt find any solution through SQL/N1QL query.
Sorry for not following up sooner. To clarify, regarding, “I want replace WHERE ANY with WHERE FIRST,” we currently do not have “WHERE FIRST,” as you wanted it. My question is, is it same as saying, Objects ?