Created
March 28, 2016 16:08
-
-
Save eiri/92ceceb090c251aa4e46 to your computer and use it in GitHub Desktop.
Listing for _compact, _rev_limit and _purge in Couch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl $db/neato -XPUT | |
{“ok”:true} | |
$ curl $db/neato -XPOST -H’Content-Type: application/json’ -d’{“key”: 1}’ | |
{“ok”:true,”id”:”b24a8da105719f433651feabff001d5d”,”rev”:”1-c77eb5d5af83163c996ea42b61a9f0d8”} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “1-c77eb5d5af83163c996ea42b61a9f0d8”, | |
“key”: 1 | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d?rev=1-c77eb5d5af83163c996ea42b61a9f0d8 -XPUT -d’{“key”: 2}’ | |
{“ok”:true,”id”:”b24a8da105719f433651feabff001d5d”,”rev”:”2-c8853300090b77593e3e1c33744ea022”} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d?rev=2-c8853300090b77593e3e1c33744ea022 -XPUT -d’{“key”: 3}’ | |
{“ok”:true,”id”:”b24a8da105719f433651feabff001d5d”,”rev”:”3-e63e5ca4850054975cae618fd31ef014”} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “3-e63e5ca4850054975cae618fd31ef014”, | |
“key”: 3 | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d rev=1-c77eb5d5af83163c996ea42b61a9f0d8 -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “1-c77eb5d5af83163c996ea42b61a9f0d8”, | |
“key”: 1 | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d revs=true -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “3-e63e5ca4850054975cae618fd31ef014”, | |
“key”: 3, | |
“_revisions”: { | |
“start”: 3, | |
“ids”: [ | |
“e63e5ca4850054975cae618fd31ef014”, | |
“c8853300090b77593e3e1c33744ea022”, | |
“c77eb5d5af83163c996ea42b61a9f0d8” | |
] | |
} | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d revs=true -d revs_info=true -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “3-e63e5ca4850054975cae618fd31ef014”, | |
“key”: 3, | |
“_revisions”: { | |
“start”: 3, | |
“ids”: [ | |
“e63e5ca4850054975cae618fd31ef014”, | |
“c8853300090b77593e3e1c33744ea022”, | |
“c77eb5d5af83163c996ea42b61a9f0d8” | |
] | |
}, | |
“_revs_info”: [ | |
{ | |
“rev”: “3-e63e5ca4850054975cae618fd31ef014”, | |
“status”: “available” | |
}, | |
{ | |
“rev”: “2-c8853300090b77593e3e1c33744ea022”, | |
“status”: “available” | |
}, | |
{ | |
“rev”: “1-c77eb5d5af83163c996ea42b61a9f0d8”, | |
“status”: “available” | |
} | |
] | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d?rev=3-e63e5ca4850054975cae618fd31ef014 -XDELETE | |
{“ok”:true,”id”:”b24a8da105719f433651feabff001d5d”,”rev”:”4-35eec2370c8c9b4840fceb97f11c1a76”} | |
eiri@StarBook ~$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -s | jq . | |
{ | |
“error”: “not_found”, | |
“reason”: “deleted” | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d rev=4-35eec2370c8c9b4840fceb97f11c1a76 -d revs=true -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “4-35eec2370c8c9b4840fceb97f11c1a76”, | |
“_deleted”: true, | |
“_revisions”: { | |
“start”: 4, | |
“ids”: [ | |
“35eec2370c8c9b4840fceb97f11c1a76”, | |
“e63e5ca4850054975cae618fd31ef014”, | |
“c8853300090b77593e3e1c33744ea022”, | |
“c77eb5d5af83163c996ea42b61a9f0d8” | |
] | |
} | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d rev=1-c77eb5d5af83163c996ea42b61a9f0d8 -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “1-c77eb5d5af83163c996ea42b61a9f0d8”, | |
“key”: 1 | |
} | |
$ curl $db/neato/_compact -XPOST -H’Content-Type: application/json’ | |
{“ok”:true} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d rev=4-35eec2370c8c9b4840fceb97f11c1a76 -d revs=true -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “4-35eec2370c8c9b4840fceb97f11c1a76”, | |
“_deleted”: true, | |
“_revisions”: { | |
“start”: 4, | |
“ids”: [ | |
“35eec2370c8c9b4840fceb97f11c1a76”, | |
“e63e5ca4850054975cae618fd31ef014”, | |
“c8853300090b77593e3e1c33744ea022”, | |
“c77eb5d5af83163c996ea42b61a9f0d8” | |
] | |
} | |
} | |
$ curl $db/neato/_revs_limit -XPUT -H’Content-Type: application/json’ -d 1 | |
{“ok”:true} | |
$ curl $db/neato/_compact -XPOST -H’Content-Type: application/json’ | |
{“ok”:true} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d rev=4-35eec2370c8c9b4840fceb97f11c1a76 -d revs=true -d revs_info=true -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “4-35eec2370c8c9b4840fceb97f11c1a76”, | |
“_deleted”: true, | |
“_revisions”: { | |
“start”: 4, | |
“ids”: [ | |
“35eec2370c8c9b4840fceb97f11c1a76” | |
] | |
} | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d?rev=4-35eec2370c8c9b4840fceb97f11c1a76 -XPUT -H’Content-Type: application/json’ -d’{“key”: 5}’ -s | jq . | |
{ | |
“ok”: true, | |
“id”: “b24a8da105719f433651feabff001d5d”, | |
“rev”: “5-f6615ee7aa8b8b2009c2e2eef43d5d12” | |
} | |
$ curl $db/neato/b24a8da105719f433651feabff001d5d -G -d rev=5-f6615ee7aa8b8b2009c2e2eef43d5d12 -d revs=true -d revs_info=true -s | jq . | |
{ | |
“_id”: “b24a8da105719f433651feabff001d5d”, | |
“_rev”: “5-f6615ee7aa8b8b2009c2e2eef43d5d12”, | |
“key”: 5, | |
“_revisions”: { | |
“start”: 5, | |
“ids”: [ | |
“f6615ee7aa8b8b2009c2e2eef43d5d12” | |
] | |
} | |
} | |
$ curl $db/neato/_purge -XPOST -H’Content-Type: application/json’ -d’{“b24a8da105719f433651feabff001d5d”: [“5-f6615ee7aa8b8b2009c2e2eef43d5d12”]}’ | |
{“purge_seq”:2,”purged”:{“b24a8da105719f433651feabff001d5d”:[“5-f6615ee7aa8b8b2009c2e2eef43d5d12”]}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment