Sure:
{
"requestID": "997c9aa7-6d64-497b-9dcd-8a6270cb65f3",
"signature": "json",
"results": [
{
"plan": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Sequence",
"~children": [
{
"#operator": "DistinctScan",
"scan": {
"#operator": "IndexScan",
"index": "migration_meta_cas_index",
"index_id": "ebcd6cf4b9c3756",
"keyspace": "bucket_name",
"limit": "100",
"namespace": "default",
"spans": [
{
"Range": {
"High": [
"0"
],
"Inclusion": 0,
"Low": [
"null"
]
}
},
{
"Range": {
"Inclusion": 0,
"Low": [
"0"
]
}
}
],
"using": "gsi"
}
},
{
"#operator": "Fetch",
"as": "d",
"keyspace": "bucket_name",
"namespace": "default"
},
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Filter",
"condition": "(not ((meta(`d`).`cas`) = 0))"
},
{
"#operator": "InitialProject",
"result_terms": [
{
"expr": "`d`",
"star": true
}
]
},
{
"#operator": "FinalProject"
}
]
}
}
]
},
{
"#operator": "Limit",
"expr": "100"
}
]
},
"text": "SELECT d.* FROM `bucket_name` d WHERE meta().cas != 0 limit 100"
}
],
"status": "success",
"metrics": {
"elapsedTime": "2.921423ms",
"executionTime": "2.874206ms",
"resultCount": 1,
"resultSize": 3730
}
}
In terms of use-case, I am keeping track of the last checked meta().cas and do something like:
SELECT d.* FROM bucket_name
where meta().cas > “last cas number” to find all the updated and added documents since we last checked.
Can u check UI and see how many entries in the index
Sorry, unfamiliar with the UI. How would I do this?
We are using Couchbase Server 4.5 if this is relevant.