couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregor Martynus <gre...@martynus.net>
Subject Re: Bug? _design docs don't get replicated when using _replicator db (couchDB 1.1.1)
Date Tue, 22 Nov 2011 15:17:28 GMT
Filipe answered my question at github:
https://gist.github.com/832610#gistcomment-64712

As for the replication of design documents, read section 8 "The user_ctx
> property and delegations". The default user_ctx doesn't have an _admin
> role, which means design documents are not replicated - this is the
> principle of the least privileges by default. Automatically adding
> user_ctx, based on the user's user_ctx who adds the document, is not out of
> question (but only for a major CouchDB version, like 2.0).
> So just add the following to the doc:
> {
> ...
> "user_ctx": {
> "name": username, // you can omit this field if you want
> "roles": ["_admin"]
> }
> }



On Tue, Nov 22, 2011 at 3:43 PM, Gregor Martynus <gregor@martynus.net>wrote:

> *1. TEST SETUP *(simplified)
> *
> *
> *db1* has 2 docs:
>
> {"_id":"test"}
> {"_id":"_design/test"}
>
> *db2* is empty.
> *
> *
> *
> *
> *
> *
> *2. REPLICATION*
> *
> *
> Now I create a replication doc in _replicator db:
>
> { "source": "db1", "target": "db2" }
>
>
>
> *3. RESULT*
> *
> *
> db2 now has 1 doc:
>
> {"_id":"test"}
>
> The other *doc {"_id":"_design/test"} is missing*.
>
> If I start the replication in the traditional way, the design doc gets
> replicated.
>
> Is this a bug or a feature?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message