Where clause on an last update timestamp on meta info?


I’m writing a small script that moves certain documents into Elasticsearch using N1QL. We have tried using the transport connector but it does not meet our needs.

All our json docs contain an insert and update epoch and hence I can query CB to only give my new or updated documents.

Would it be possible to hit the atomic count documents with some type of where clause where we could only query for new atomic documents - since the docs itself only contain a counter value and no timestamp in them. Possibly use the meta info to make the query work?



I just ran

select meta(b) from beer-sample b limit 1;

The result does not include any timestamp. Can you just move all the atomic counters?

Thanks for helping!

Hmm - we could move all our atomic counters but the problem is that there are quite a few of them and the way I had envisioned this script is that it would run once every few minutes and only move the newly inserted or updated docs over to ES.

We probably will have a very large number of counter docs.

I was under the impression that cb would use data in the meta docs to determine if a doc stays in memory or gets paged to disk - is that true? - cuz, as you have pointed out the mets doc returned by N1QL doesn’t contain much info other than CAS, flags, ID and type.