The documentation here:
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/indexing-meta-info.html
Indicates that metadata like “flags” and “type” can be indexed. There are also some virtual extended attributes that would be useful but are not allowed. For example, “value_bytes” and “last_modified”.
When trying to index those attributes (for example, meta().xattrs.$document
.value_bytes
) the creation fails with:
Fails to create index. Cannot index on Virtual Extended Attributes.
Is there any chance that “value_bytes” or “last_modified” may make it onto the list of attributes that can be indexed through meta? In the meantime it looks like you can size the JSON directly and add it to an index.