Skip to content

Commit

Permalink
Add Riak day 3 homework
Browse files Browse the repository at this point in the history
  • Loading branch information
peferron committed Nov 15, 2016
1 parent aa719b3 commit 4cd35cc
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions riak/homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
### 1.

```
curl -i -X PUT "http:https://localhost:10038/riak/animals/polly" \
curl -X PUT "http:https://localhost:10038/riak/animals/polly" \
-H "Link: </riak/photos/polly.jpg>; riaktag=\"photo\"" \
-d '{"nickname": "Sweet Polly Purebred", "breed": "Purebred"}'
```

### 2.

```
curl -i -X PUT "http:https://localhost:10038/riak/cats/takkun.svg" \
curl -X PUT "http:https://localhost:10038/riak/cats/takkun.svg" \
-H "Content-Type: image/svg+xml" \
--data-binary @takkun.svg
```

### 3.

```
curl -i -X PUT "http:https://localhost:10038/riak/medicines/antibiotics" \
curl -X PUT "http:https://localhost:10038/riak/medicines/antibiotics" \
-H "Content-Type: image/jpeg" \
-H "Link: </riak/animals/ace>; riaktag=\"treats\"" \
--data-binary @antibiotics.jpg
Expand All @@ -32,8 +32,9 @@ curl -i -X PUT "http:https://localhost:10038/riak/medicines/antibiotics" \
### 1.

```
curl -X POST -H "content-type:application/json" \
"http:https://localhost:10018/mapred" --data @-
curl -X POST "http:https://localhost:10018/mapred" \
-H "content-type:application/json" \
--data @-
{
"inputs": "rooms",
"query": [
Expand Down Expand Up @@ -70,8 +71,9 @@ curl -X POST -H "content-type:application/json" \
### 2.

```
curl -X POST -H "content-type:application/json" \
"http:https://localhost:10018/mapred" --data @-
curl -X POST "http:https://localhost:10018/mapred" \
-H "content-type:application/json" \
--data @-
{
"inputs": {
"bucket": "rooms",
Expand Down Expand Up @@ -107,3 +109,26 @@ curl -X POST -H "content-type:application/json" \
]
}
```

## Day 3

### 1.

Insert an animal with a score of 3:

```
curl -X PUT "http:https://localhost:10038/riak/animals/ace" \
-H "Content-Type: application/json" \
-H "x-riak-index-score_int: 3" \
-d '{"nickname": "The Wonder Dog", "breed": "German Shepherd"}'
```

Query all animals with a score between 1 and 3, inclusive:

```
curl -i "http:https://localhost:10028/buckets/animals/index/score_int/1/3"
```

### 2.

Skipped.

0 comments on commit 4cd35cc

Please sign in to comment.