Replies: 5 comments
-
@nono I had the same idea many years ago when implementing the So it should already work! Sadly, I don't think we ever documented it... |
Beta Was this translation helpful? Give feedback.
-
It still works it seems
|
Beta Was this translation helpful? Give feedback.
-
Oh, it's very powerful. We can also use it to skip $ curl "http://localhost:5984/db/_changes?include_docs=true&filter=_selector" -H "Content-Type: application/json" -d '{"selector": {"_deleted": {"$exists": false}}, "fields": ["a"]}' What do you think about documenting it now? Is it something that will be still available with CouchDB 4? |
Beta Was this translation helpful? Give feedback.
-
We should document it since it already works, yeah. The idea was to apply it to replications. It would work at the code level easily, but it would introduce tricky semantic side-effects. For example, it would replicate docs with same revision, say 1-a123... but having doc bodies which are different . In Apache CouchDB (unlike other CouchDB-like databases), revisions are generated from a hash of the doc body contents and the previous revision. Perhaps this change is easy to document and explain but I haven't thought of possible negative ramifications of it. For skipping _deleted docs, it's possible to already do with: "selector": {
"_deleted": {
"$exists": false
}
} Borrowed from https://blog.cloudant.com/2019/12/13/Filtered-Replication.html#ignoring-deletions |
Beta Was this translation helpful? Give feedback.
-
IIRC, Pouch doesn't use the same algorithm for revisions, and I don't think it's an issue for replications between CouchDB and PouchDB. |
Beta Was this translation helpful? Give feedback.
-
Hello,
the
fields
parameter for the mango requests allow to fetch only some fields inside the documents, and it can help a lot to avoid some heavy fields and decrease the transfer size. I would like to have the same things for the changes feed. Sometimes, I use the changes feed not for replication, but just as a way to process some documents that have changed since the last time, and I don't need all the fields of the documents. Am I the only one in this case? What do you think of having afields
parameter for other things that mango?Beta Was this translation helpful? Give feedback.
All reactions