How to convert a n1ql statement into mobile sql++?

Thanks for the suggestion. i found we have data in a slightly different format which allowed me to bypass the parallel arrays. i verified the query works in CBLite 3.0, but the problem is it’s very slow, around 30 seconds on my simulator and even worse on a phone with our data (around 1000 loc documents).

i saw a message from dec 2020 that array indexes are not supported on mobile yet (Array indexing with Couchbase Lite - #5 by priya.rajagopal)

is it possible to add an index to speed up this query? if not, then we’ll have to change our document structure. i’m hoping to avoid that.

edit: i noticed that createQuery takes a long time, but execute is very fast. if an index is not possible, perhaps i can just hold onto my query and execute it multiple times as needed? it is possible for documents to change throughout the day, so i’m hoping calling execute will pick it back up later.

{
    "delProfs": [
        {
            "delProf": {
                "seq": [
                    [
                    "7150",
                    "2",
                    0
                    ]
                    ]
            }
        }
    ]
}
select meta().id 
from _ 
where type = 'loc' 
and delProfs is not missing 
and ( ANY x in delProfs   SATISFIES    (any y in x.delProf.seq satisfies y[0]='7150' and y[1]='2' end)   END )