couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Ananich <anton.anan...@inpun.com>
Subject Re: How to update just a field
Date Fri, 25 Jan 2013 21:20:08 GMT
Actually you have to update all the document.
However there is an option. You can create couchapp and update
handler. This way you'll be able to avoid transferring all he document
though a network. But the update handler will update entire document
anyway.

On Fri, Jan 25, 2013 at 11:58 PM, Jaisol <jaisol@hotmail.com> wrote:
> Hi,
>
> I've added one document to my db.
>
> # cat file.json
> {
>    "docs": [
>       {
>          "_id": "prod",
>          "sysAdmins": [
>             "admin",
>             "sys_admin"
>          ],
>          "webDeploy": {
>             "source": "server1.domain.com",
>             "username": "myUser",
>             "password": "xxxxxx",
>             "websites": {
>                "site1.domain.com": {
>                   "path": "d:\\websites\\site1.domain.com",
>                   "appPoolIdentity": "domain\\sys_site1"
>                },
>                "site2.domain.com": {
>                   "path": "d:\\websites\\site2.domain.com",
>                   "appPoolIdentity": "domain\\sys_site2"
>                }
>             }
>          }
>       }
>    ]
> }
>
> #curl -d @file.json -X POST http://localhost/mydb/_bulk_docs -H "Content-Type:
> application/json"
> [{"id":"prod","rev":"1-a4f83f088384ea39ad593e4b4c2f7018"}]
>
>
> I'm so new on this.
> I've read the HTTP API and I still don't figure out how to update or delete just
> one field.
> 1. Update the webDeploy field ?
> 2. Delete the sysAdmins field ?
>
> Sorry to bother you with a newbie question.
>
> Any advice is greatly appreciated. Thanks!
>

Mime
View raw message