Re: overwrite document without revision?

2013-11-13 Thread Ryan Mohr
Of course it is, but Alex asked can I not should I.

Re: overwrite document without revision?

2013-11-12 Thread Ryan Mohr
Dave, this isn't my thread. Alex had asked: Is there any way to unconditionally overwrite a document without first making a round-trip to get the current rev? Everyone said no. Looks like it's totally doable using new_edits=false and a script that resolves any conflicts by simply picking the

Re: overwrite document without revision?

2013-11-10 Thread Ryan Mohr
Jens - Can you expand on this more or point me to documentation that covers this in detail? On Friday, November 8, 2013, Jens Alfke wrote: This would add a new revision, but it'd be a new roots in the revision tree (i.e. a sibling not a child of the previous revision.) This would essentially

Re: overwrite document without revision?

2013-11-10 Thread Alexander Shorin
On Mon, Nov 11, 2013 at 1:36 AM, Ryan Mohr r...@kumu.io wrote: Can you expand on this more or point me to documentation that covers this in detail? From wiki link you posted: rather than being the parent revision ID to be matched against, it's the existing revision ID that will be saved

Re: overwrite document without revision?

2013-11-10 Thread Dave Cottlehuber
Hi Ryan, You're desperately trying to find a way to make CouchDB's immutable storage system work like a mutable one. Please don't :-) -- it's going against the grain. I'd suggest taking a step back for a moment, reading carefully through these 2 sections in particular from the guide:

overwrite document without revision?

2013-11-08 Thread Alex Ramos
Is there any way to unconditionally overwrite a document without first making a round-trip to get the current rev? I'm trying to use CouchDB as a data warehouse of sorts and I just need to overwrite docs with data coming from the transactional system of record (in MySQL) when they change.

Re: overwrite document without revision?

2013-11-08 Thread Stanley Iriele
Update handlers sound like the way to go here On Nov 8, 2013 9:39 AM, Alex Ramos i2...@alexramos.net wrote: Is there any way to unconditionally overwrite a document without first making a round-trip to get the current rev? I'm trying to use CouchDB as a data warehouse of sorts and I just

Re: overwrite document without revision?

2013-11-08 Thread Robert Newson
There is not, not even update handlers can do that, by design. B. On 8 November 2013 17:41, Stanley Iriele siriele...@gmail.com wrote: Update handlers sound like the way to go here On Nov 8, 2013 9:39 AM, Alex Ramos i2...@alexramos.net wrote: Is there any way to unconditionally

Re: overwrite document without revision?

2013-11-08 Thread Daniel Nephin
Isn't this the default behaviour? All you need to update a document is it's '_id'. Since this is a data warehouse, I assume the ID is already being set by the transaction system, so you don't need to do a lookup. If you PUT a document (

Re: overwrite document without revision?

2013-11-08 Thread Stanley Iriele
I still think you can use update handlers for that...just send the doc over the wire... Parse it and save it in the db with the current revision of the current doc if it exists...you. Can't do this in bulk... And I think what you're trying to Dave is the round trip... Which the update handler

Re: overwrite document without revision?

2013-11-08 Thread Stanley Iriele
But no you can't just throw a doc in the db without the latest revision if it already exists On Nov 8, 2013 1:39 PM, Stanley Iriele siriele...@gmail.com wrote: I still think you can use update handlers for that...just send the doc over the wire... Parse it and save it in the db with the current

Re: overwrite document without revision?

2013-11-08 Thread Robert Newson
Update handlers can still fail with a 409. :) B. On 8 November 2013 21:40, Stanley Iriele siriele...@gmail.com wrote: But no you can't just throw a doc in the db without the latest revision if it already exists On Nov 8, 2013 1:39 PM, Stanley Iriele siriele...@gmail.com wrote: I still

Re: overwrite document without revision?

2013-11-08 Thread Stanley Iriele
Right right :-D..meh...I nice while not =409 loop should help with that... On Nov 8, 2013 1:42 PM, Robert Newson rnew...@apache.org wrote: Update handlers can still fail with a 409. :) B. On 8 November 2013 21:40, Stanley Iriele siriele...@gmail.com wrote: But no you can't just throw a

Re: overwrite document without revision?

2013-11-08 Thread Jens Alfke
On Nov 8, 2013, at 12:53 PM, Daniel Nephin dnep...@gmail.commailto:dnep...@gmail.com wrote: Am I missing something? Yes. To update a document you need its current _rev ID, not just the _id. —Jens

RE: overwrite document without revision?

2013-11-08 Thread Naik, Purushottam
, 2013 5:46 PM To: user@couchdb.apache.org Subject: Re: overwrite document without revision? On Nov 8, 2013, at 12:53 PM, Daniel Nephin dnep...@gmail.commailto:dnep...@gmail.com wrote: Am I missing something? Yes. To update a document you need its current _rev ID, not just the _id. -Jens

Re: overwrite document without revision?

2013-11-08 Thread Robert Newson
Main 770-420-2388 Fax770-420-9650 pn...@ballytech.com -Original Message- From: Jens Alfke [mailto:j...@couchbase.com] Sent: Friday, November 08, 2013 5:46 PM To: user@couchdb.apache.org Subject: Re: overwrite document without revision? On Nov 8, 2013, at 12:53 PM, Daniel

Re: overwrite document without revision?

2013-11-08 Thread Dave Benson
@couchdb.apache.org Subject: Re: overwrite document without revision? On Nov 8, 2013, at 12:53 PM, Daniel Nephin dnep...@gmail.commailto: dnep...@gmail.com wrote: Am I missing something? Yes. To update a document you need its current _rev ID, not just the _id. -Jens

Re: overwrite document without revision?

2013-11-08 Thread Ryan Mohr
Couldn't you do this with _bulk_docs and new_edits:false? http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Posting_Existing_Revisions

Re: overwrite document without revision?

2013-11-08 Thread Jens Alfke
On Nov 8, 2013, at 7:07 PM, Ryan Mohr r...@kumu.io wrote: Couldn't you do this with _bulk_docs and new_edits:false? This would add a new revision, but it'd be a new roots in the revision tree (i.e. a sibling not a child of the previous revision.) This would essentially create a conflict, and