You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Daniel Suen <tt...@yahoo.com.INVALID> on 2014/07/05 02:32:17 UTC
Replicate n documents to another database?
I am new to couchdb, is there a way to replicate n documents from a database A to another database B?
I want to set up some test data from a large database, and the fastest is to just replicate n arbitrary documents from that database. I checked the _replicate interface, and it seems that I cannot specify A/_all_docs?limit=n as the source...
Any help is appreciated. Thanks.
Daniel.
Re: Replicate n documents to another database?
Posted by Jens Alfke <je...@couchbase.com>.
On Jul 4, 2014, at 5:32 PM, Daniel Suen <tt...@yahoo.com.INVALID> wrote:
> I want to set up some test data from a large database, and the fastest is to just replicate n arbitrary documents from that database. I checked the _replicate interface, and it seems that I cannot specify A/_all_docs?limit=n as the source...
You can specify a set of document IDs to replicate. And you can get a set of document IDs from _all_docs?limit=n. You’ll just need to write a bit of glue code to extract the doc IDs from the _all_docs response, and put them into the request to _replicate.
—Jens