Skip to content

Commit

Permalink
README: Add another common example for "Read data"
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell committed Apr 25, 2022
1 parent 9e143f3 commit 686a160
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ Ret = khepri:get("/:emails/alice"),
data => "[email protected]",
payload_version => 1}}} = Ret.
```
```erlang
%% Get the data directly, providing a default value if there is no data:
"[email protected]" = khepri:get_data_or("/:emails/alice", undefined).
```

The `khepri:get/0` function and many other ones accept a "path pattern".
Therefore it is possible to get several nodes in a single call. The result is a
Expand Down

0 comments on commit 686a160

Please sign in to comment.