Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion couchdb.http.ResourceConflict: ('conflict', 'Document update conflict.')

Received: by 10.90.33.18 with SMTP id g18mr833238agg.3.1287592270735;
        Wed, 20 Oct 2010 09:31:10 -0700 (PDT)
X-BeenThere: couchdb-python@googlegroups.com
Received: by 10.90.116.16 with SMTP id o16ls180528agc.7.p; Wed, 20 Oct 2010
 09:31:07 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.90.84.17 with SMTP id h17mr49942agb.54.1287592267858; Wed, 20
 Oct 2010 09:31:07 -0700 (PDT)
Received: by 30g2000yqm.googlegroups.com with HTTP; Wed, 20 Oct 2010 09:31:07
 -0700 (PDT)
Date: Wed, 20 Oct 2010 09:31:07 -0700 (PDT)
In-Reply-To: <AANLkTincnbmkqr62KRV7XiFgJSNmim5Nnr1uD0x_GEPZ@mail.gmail.com>
X-IP: 86.130.164.183
References: <d0662ffd-3684-463c-bbd7-5c80debf4e2a@c21g2000vba.googlegroups.com>
 <AANLkTikp+SHX3as=+UvK_39mKDFRjTb1Zc7Mjh1vk9H+@mail.gmail.com>
 <08185ee2-c768-4186-af3e-ada0388e21a1@y31g2000vbt.googlegroups.com> <AANLkTincnbmkqr62KRV7XiFgJSNmim5Nnr1uD0x_GEPZ@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US)
 AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7,gzip(gfe)
Message-ID: <dc7a83a1-18ab-4ff5-9a7d-bff1c898d823@30g2000yqm.googlegroups.com>
Subject: Re: couchdb.http.ResourceConflict: ('conflict', 'Document update conflict.')
From: handloomweaver <a.w.macmil...@gmail.com>
To: CouchDB-Python <couchdb-python@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

That was really helpful and did indeed work. Now I want to save to
couchdb fields that contain multiple values that are appended over
time. So in the same vein. How would I save to a ListField to append
to the list and not overwrite what's there?


On Oct 13, 8:23=A0pm, Matt Goodall <matt.good...@gmail.com> wrote:
> On 13 October 2010 17:58, handloomweaver <a.w.macmil...@gmail.com> wrote:
>
> > Hi
>
> > Now that works but it seems to create a new document and not update
> > the existing? Is that wrong or is that how couchdb works?
>
> If you use the same _id it should not create a new document. For
> instance, using a new, blank database:
>
> >>> len(list(db.view('_all_docs')))
> 0
> >>> db.save({'_id': 'me', 'name': 'Matt'})
>
> ('me', '1-47804390369d435cb116403da935bdd5')>>> len(list(db.view('_all_do=
cs')))
> 1
> >>> me =3D db.get('me')
> >>> me
>
> <Document 'me'@'1-47804390369d435cb116403da935bdd5' {'name': 'Matt'}>>>> =
me['name'] =3D 'Matt Goodall'
> >>> db.save(me)
>
> ('me', '2-8b7344ea179d5b721ce4546e1a4566a9')>>> len(list(db.view('_all_do=
cs')))
>
> 1
>
> Are you sure you're using the same _id? If you are sure, please could
> you post a short example that creates two documents.
>
> - Matt
>
>
>
>
>
>
>
>
>
> > AL
> > On Oct 13, 5:36=A0pm, Matt Goodall <matt.good...@gmail.com> wrote:
> >> On 13 October 2010 17:23, handloomweaver <a.w.macmil...@gmail.com> wro=
te:
>
> >> > Hi
>
> >> > I would appreciate some advice. I'm trying to simply update an
> >> > existing document. I thought from reading the docs it was the same
> >> > process as creating a new document. I've made an email address my do=
c
> >> > id in this instance
>
> >> When you update an existing document you must include the document's
> >> current _rev. CouchDB checks the _rev is correct before updating the
> >> database.
>
> >> In practice, this means you must first get the document from the
> >> database before making changes and saving it. For example, to change a
> >> password you would do:
>
> >> =A0 doc =3D db.get('...@atomised.coop')
> >> =A0 doc['password'] =3D '35gst66s'
> >> =A0 db.save(doc)
>
> >> Hope that helps.
>
> >> - Matt
>
> >> > doc =3D {'_id' : '...@atomised.coop', =A0'password' : '35gst66s'}
> >> > db.save(doc)
>
> >> > Traceback (most recent call last):
> >> > =A0File "<stdin>", line 1, in <module>
> >> > =A0File "/home/almacmillan/lib/python2.6/CouchDB-0.8-py2.6.egg/couch=
db/
> >> > client.py", line 407, in save
> >> > =A0File "/home/almacmillan/lib/python2.6/CouchDB-0.8-py2.6.egg/couch=
db/
> >> > http.py", line 405, in put_json
> >> > =A0File "/home/almacmillan/lib/python2.6/CouchDB-0.8-py2.6.egg/couch=
db/
> >> > http.py", line 384, in put
> >> > =A0File "/home/almacmillan/lib/python2.6/CouchDB-0.8-py2.6.egg/couch=
db/
> >> > http.py", line 419, in _request
> >> > =A0File "/home/almacmillan/lib/python2.6/CouchDB-0.8-py2.6.egg/couch=
db/
> >> > http.py", line 306, in request
> >> > couchdb.http.ResourceConflict: ('conflict', 'Document update
> >> > conflict.')
>
> >> > Am I getting this wrong or is this a bug?
>
> >> > I am a beginner programmer so this may very well be so!
>
> >> > Any help really appreciated
>
> >> > Kind thanks
> >> > AL
>
> >> > --
> >> > You received this message because you are subscribed to the Google G=
roups "CouchDB-Python" group.
> >> > To post to this group, send email to couchdb-python@googlegroups.com=
.
> >> > To unsubscribe from this group, send email to couchdb-python+unsubsc=
ribe@googlegroups.com.
> >> > For more options, visit this group athttp://groups.google.com/group/=
couchdb-python?hl=3Den.
>
> > --
> > You received this message because you are subscribed to the Google Grou=
ps "CouchDB-Python" group.
> > To post to this group, send email to couchdb-python@googlegroups.com.
> > To unsubscribe from this group, send email to couchdb-python+unsubscrib=
e@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/cou=