Reputation: 491
We have a couchDB instance with hundreds of databases. For each database we would like to store the current number of documents (potentially by type) in a dedicated document which can then be replicated to another database for seach purposes. We have a view with map/reduce to compute the statistics but it seems replication only works on documents but not on views.
Is there another way how to synchronise statistics of one database to a document which can be replicated to another database?
Upvotes: 0
Views: 21
Reputation: 27971
You said:
it seems replication only works on documents but not on views
...but design documents are replicated just like any other document, unless the replication filters them out. So I'm not sure what that means, but in any case I'm not sure how replicating the view will achieve your stated aim.
You seem to need to run the view to generate the statistics you want, and then store those statistics in another document which is then replicated to the target database. I'm guessing that the missing piece is understanding that you need to actually run that process (running the view, then creating/updating a document with the stats from that view) from outside the DB?
Upvotes: 1