Created
November 6, 2012 05:34
-
-
Save clr/4022791 to your computer and use it in GitHub Desktop.
Basic Querying Examples
This file contains 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 -X PUT http://127.0.0.1:8091/buckets/qcon/keys/nosql4evah \ | |
-H 'content-type: text/plain' \ | |
-d $'Scale out all the things!\n' | |
curl -X GET http://127.0.0.1:8091/buckets/qcon/keys/nosql4evah | |
curl -X DELETE http://127.0.0.1:8091/buckets/qcon/keys/nosql4evah | |
curl -X GET http://127.0.0.1:8091/buckets/qcon/keys/nosql4evah |
This file contains 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 -X PUT http://localhost:8091/buckets/qcon_mr/keys/foo -H 'Content-Type: text/plain' -d 'pizza data goes here' | |
curl -X PUT http://localhost:8091/buckets/qcon_mr/keys/bar -H 'Content-Type: text/plain' -d 'pizza pizza pizza pizza' | |
curl -X PUT http://localhost:8091/buckets/qcon_mr/keys/baz -H 'Content-Type: text/plain' -d 'nothing to see here' | |
curl -X PUT http://localhost:8091/buckets/qcon_mr/keys/bam -H 'Content-Type: text/plain' -d 'pizza pizza pizza' | |
curl -X POST http://localhost:8091/mapred -H 'Content-Type: application/json' -d '{ | |
"inputs":"qcon_mr", | |
"query":[{"map":{"language":"javascript", | |
"source":"function(riakObject) { | |
var m = riakObject.values[0].data.match(/pizza/g); | |
return [[riakObject.key, (m ? m.length : 0 )]]; | |
}"}}]}' |
This file contains 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
# don't forget to open app.config and switch storage_backend to riak_kv_eleveldb_backend | |
curl -X PUT http://localhost:8091/buckets/qcon_2i/keys/apple \ | |
-H 'x-riak-index-category_bin: fruit' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'malus domestica' | |
curl -X PUT http://localhost:8091/buckets/qcon_2i/keys/banana \ | |
-H 'x-riak-index-category_bin: fruit' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'musa acuminata' | |
curl -X PUT http://localhost:8091/buckets/qcon_2i/keys/tomato \ | |
-H 'x-riak-index-category_bin: fruit' \ | |
-H 'x-riak-index-category_bin: vegetable' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'solanum lycopersicum' | |
curl -X PUT http://localhost:8091/buckets/qcon_2i/keys/potato \ | |
-H 'x-riak-index-category_bin: vegetable' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'solanum tuberosum' | |
curl http://localhost:8091/buckets/qcon_2i/index/category_bin/fruit | |
curl http://localhost:8091/buckets/qcon_2i/index/category_bin/vegetable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment