I have some documents I would like to replicate to per user databases but only with a subset of fields on the main document. The "selector" option works great to easily select the docs I need but it does not appear to support the "fields" option. I can't find a way to do this without manually filtering the document fields on my node server, which seems quite inefficient.
Asked
Active
Viewed 283 times
1 Answers
1
It is not possible to replicate part of a document. The CouchDB replication mechanism is replicating the whole document as a unit.
I suggest you to review your document design in order to have a better fit with the replication requirements. Maybe it is more accurate to have two separate documents in your case.

Juanjo Rodriguez
- 2,103
- 8
- 19
-
For my app I have user documents. Users need to see a subset of data for other user documents. I don't really see a way in which it can make sense for that to be two separate databases. I could have "public user data" database and "private user data" database, but that would seem like a hack. The client and server would need to merge one document from each database to construct the "true" user document. – imagio Jan 22 '18 at 16:28
-
The idea is to have one document type for public data and other document type for private data in the same database, then you can use filtered replication in order to retrieve the proper information. – Juanjo Rodriguez Jan 22 '18 at 17:08