0

I want to update or insert a filed in my document in CouchDB without a new rev number. Is that possible with curl ?

For example like Futon. If i open a document with futon and add a new field or update a filed its done without a new revision number. The changes are at the same document.

kayleeFrye_onDeck
  • 6,648
  • 5
  • 69
  • 80
Relaxo
  • 43
  • 6

1 Answers1

1

You can't. Futon cannot do it either. It looks like Futon is no changing the rev number because it only updates the document (and changes the rev) when you hit save.

Everything is explained very well in the Guide.

Simon
  • 31,675
  • 9
  • 80
  • 92
  • Thanks for you answer Simon. But now. I updated my document with Curl. But i have one Problem. If i opened my document I see a new revision number. Thats finde but all other fileds are not there. It is in the first rev. number but not at the second revision number. But I want to have all fields with the update in the second rev number too. Is there any opportunity ? – Relaxo Mar 08 '15 at 16:12
  • Yes, that's how it works. You read the doc which contains the latest rev plus all the other fields, you add a field, then you save this updated document as a whole. You cannot append to a document, you replace it. – Simon Mar 08 '15 at 16:33
  • Futon works the same. When you it _save_, you have the full document in front of your eyes, not just the new fields. – Simon Mar 08 '15 at 18:08
  • simon i know. I opened futon and add a new field. Than i klick save the document. than i get a new rev. number. after this step i know that i see the full document and not only the new fields. But with curl its not the same. if i update my document with curl. I get a new rev. number and the new rev. number contains only the new field and not the full document. you know what i mean ? Its not the same like futon. Is there any opportunity to do it like futon with curl ? – Relaxo Mar 08 '15 at 20:04
  • Same thing with curl, you GET the document, then you PUT the updated document. I can't really help you beyond that but you can easily find [examples](http://nefariousdesigns.co.uk/couchdbs-restful-api.html)… – Simon Mar 08 '15 at 22:06