forked from rabbitmq/khepri
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README: Add another common example for "Read data"
- Loading branch information
Showing
1 changed file
with
4 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|