Hi, I created TTL and set expiry and my meta look like as below :
and I run N1QL as below :
select Meta(Demo).expiration from Demo;
but it return all blanks like this :
so how I can query on expiration meta key ? I want to find out next expiration documents.
META().expiration will give 0 for non covered queries. This is known issue.
You can create index on expiration and do covered query
CREATE INDEX ix1 ON Demo(META().expiration);
SELECT META().id, META().expiration FROM Demo WHERE META().expiration IS NOT NULL;
What shoud I do, if it doesn’t work for me? Explain says that it always rides a primary index.
I’m using: Community Edition 6.0.0 build 1693 ‧ IPv4
It should post your query.