Skip to content

Commit

Permalink
Updating README.md
Browse files Browse the repository at this point in the history
- Patch Merge
- Search Aggregate
  • Loading branch information
SocalNick committed Jan 25, 2015
1 parent 8a0ccfb commit 6d7c68e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Expand Up @@ -67,6 +67,25 @@ $kvPatchOperationsOp
$result = $client->execute($kvPatchOperationsOp);
```

## Patch (partial update - merge)
```php
use SocalNick\Orchestrate\KvPatchMergeOperation;
$partial = [
'birth_place' => [
'city' => 'New York',
'country' => null,
'state' => 'New York',
],
'first_name' => null,
'deprecated_first_name' => 'John',
'name' => 'John Foster',
'age' => 29,
'years_until_death' => 39,
];
$kvPatchMergeOp = new KvPatchMergeOperation('first_collection', 'third_key', json_encode($partial));
$result = self::$client->execute($kvPatchMergeOp);
```

## Get
```php
use SocalNick\Orchestrate\KvFetchOperation;
Expand Down Expand Up @@ -152,6 +171,15 @@ $total = $searchResult->totalCount(); // 8
$firstKey = $searchResult->getValue()['results'][0]['path']['key']; // lock_stock_and_two_smoking_barrels
```

## Search aggregate
```php
use SocalNick\Orchestrate\SearchAggregateOperation;
$searchOp = new SearchAggregateOperation("films", 'value.imdbRating:stats');
$searchResult = $client->execute($searchOp);
$min = $searchResult->getValue()['aggregates'][0]['statistics']['min']; // 5.9
$max = $searchResult->getValue()['aggregates'][0]['statistics']['max']; // 9.3
```

# Events

## Put defaults to now
Expand Down

0 comments on commit 6d7c68e

Please sign in to comment.