Skip to content

Commit

Permalink
update README to fix Redis Stream examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sewenew committed Oct 25, 2021
1 parent 6ed1af7 commit de57951
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2269,8 +2269,9 @@ Attrs attrs = { {"f1", "v1"}, {"f2", "v2"} };
// Add an item into the stream. This method returns the auto generated id.
auto id = redis.xadd("key", "*", attrs.begin(), attrs.end());

// Each item is assigned with an id: pair<id, attributes>.
using Item = std::pair<std::string, Attrs>;
// Each item is assigned with an id: pair<id, Optional<attributes>>.
// NOTE: the attribute part might be nil reply, check [this issue](https://github.com/sewenew/redis-plus-plus/issues/283) for detail.
using Item = std::pair<std::string, Optional<Attrs>>;
using ItemStream = std::vector<Item>;

// If you don't care the order of items in the stream, you can also use unordered_map:
Expand Down

0 comments on commit de57951

Please sign in to comment.