With the following query, it does not return any result.
select 1 from zs a
JOIN zs b ON KEY b.parent FOR a
where a.tag.token = ‘c7468adf-ac8a-4551-a4fa-3b136f9d76ca’ and a.tag.expiryepoch > 1 and a.metadata.published > 1 and b.abc = 1
However if you were to change the query to the following, you actually get 1 resultset.
select * from zs a
JOIN zs b ON KEY b.parent FOR a
where a.tag.token = ‘c7468adf-ac8a-4551-a4fa-3b136f9d76ca’ and a.tag.expiryepoch > 1 and a.metadata.published > 1 and b.abc = 1
CREATE INDEX zs1
ON zs
(parent
,abc
)
Document A
{
“parent”: “1496116023888_5a14fc5c-e29a-4fd8-90c4-e052748ff01c”,
“deleted”: false
}
Document B
{
“parent”: “1496116023888_5a14fc5c-e29a-4fd8-90c4-e052748ff01c”,
“deleted”: true,
“abc”: 1
}
Document 1496116023888_5a14fc5c-e29a-4fd8-90c4-e052748ff01c
{
“metadata”: {
“published”: 1496116023888,
},
“tag”: {
“expiryepoch”: 1496202423888,
“token”: “c7468adf-ac8a-4551-a4fa-3b136f9d76ca”
}
}