Couch DB Notes

Couch DB Notes

All CouchDB related notes are here

https://kore-nordmann.de/blog/couchdb_a_use_case.html

docker run -d -p 5984:5984 couchdb

http://localhost:5984/

Is couchDB Running
Is couchDB Running

Open Web Interface Fauxton

http://127.0.0.1:5984/_utils/

Querying 

https://stackoverflow.com/questions/33812501/find-the-duplicate-value-in-couchdb

Specific Revisions 

http://localhost:5984/sampledb/f47da1f53f2aaf6d1b9ea56b950007f2?rev=2-0b5ff97a08f57600d724186cbacb6b67

// 20180524122822
// http://localhost:5984/sampledb/f47da1f53f2aaf6d1b9ea56b950007f2?rev=2-0b5ff97a08f57600d724186cbacb6b67

{
"_id": "f47da1f53f2aaf6d1b9ea56b950007f2",
"_rev": "2-0b5ff97a08f57600d724186cbacb6b67",
"name": "sumit arora",
"address": "new stead"
}

http://localhost:5984/sampledb/f47da1f53f2aaf6d1b9ea56b950007f2?rev=1-f76cb28b94f4d9d8effe3dfc680ce13c

Open All Revisions

http://localhost:5984/sampledb/f47da1f53f2aaf6d1b9ea56b950007f2?revs_info=true

// 20180524122515
// http://localhost:5984/sampledb/f47da1f53f2aaf6d1b9ea56b950007f2?revs_info=true

{
"_id": "f47da1f53f2aaf6d1b9ea56b950007f2",
"_rev": "3-85c7fb2ca8aa4511e4de55a918bbc478",
"name": "sumit arora",
"address": "delhi stead",
"_revs_info": [
{
"rev": "3-85c7fb2ca8aa4511e4de55a918bbc478",
"status": "available"
},
{
"rev": "2-0b5ff97a08f57600d724186cbacb6b67",
"status": "available"
},
{
"rev": "1-f76cb28b94f4d9d8effe3dfc680ce13c",
"status": "available"
}
]
}

// http://localhost:5984/sampledb/f47da1f53f2aaf6d1b9ea56b950007f2?revs_info=true

{
"_id": "f47da1f53f2aaf6d1b9ea56b950007f2",
"_rev": "5-2c5f8f49c9725fa252d9f15ca2a222bd",
"name": "sumit arora",
"address": "sihala stead",
"phone": "1234567890",
"_revs_info": [
{
"rev": "5-2c5f8f49c9725fa252d9f15ca2a222bd",
"status": "available"
},
{
"rev": "4-d247424ceea7b7a8912f12b8b403d0e6",
"status": "available"
},
{
"rev": "3-85c7fb2ca8aa4511e4de55a918bbc478",
"status": "available"
},
{
"rev": "2-0b5ff97a08f57600d724186cbacb6b67",
"status": "available"
},
{
"rev": "1-f76cb28b94f4d9d8effe3dfc680ce13c",
"status": "available"
}
]
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s