incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <randall.le...@gmail.com>
Subject Re: What's the best way to jack up the rev number?
Date Fri, 09 Sep 2011 07:22:01 GMT
On Mon, Aug 22, 2011 at 02:03, Jason Smith <jhs@iriscouch.com> wrote:

> On Mon, Aug 22, 2011 at 12:04 PM, Ryan Ramage <ryan.ramage@gmail.com>
> wrote:
> > How to I grant mega points for a fantastic answer? Thanks Jason.
> >
> > A summary from the link....I have a master couchapp that clients pull
> > replicate from. A refactoring of the couchapp may mess up the rev number
> for
> > the main design doc. So i need a way to go past the rev number to force
> an
> > update to the clients. Is there a better way?
>
> Maybe a few ideas?
>

Here's another nasty way to trick CouchDB, just for fun:

PUT the new version of the document with whatever _rev you want and put
?new_edits=false in the query string.
Couch will accept the new revision no matter what. Replication uses this
feature to bypass the conflict rejections and merge conflicting trees.
Choose whatever number you feel like and abuse the definition of "winning"
revision so your newest one is what shows up :).

You should still DELETE the old revisions or you'll proliferate conflicts
and that puts unnecessary burden on couch in some places.

-Randall

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