Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

a more clarification about what INCR can be used for

  • Loading branch information...
commit c282e6da48a7624f02d7812671bd47f38be25278 1 parent 53ba594
@tnm tnm authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 recipes/2_basic_commands/create_unique_ids/recipe.md
View
10 recipes/2_basic_commands/create_unique_ids/recipe.md
@@ -6,19 +6,19 @@ You want to atomically provide a unique ID for an arbitrary object.
Utilize Redis' built-in atomic INCR function.
- $redis-cli INCR <an_object_name>
+ $redis-cli INCR <next_object_id>
(integer) 1
- $redis-cli INCR <an_object_name>
+ $redis-cli INCR <next_object_id>
(integer) 2
- $redis-cli INCR <another_object_name>
+ $redis-cli INCR <another_next_object_id>
(integer) 1
- $redis-cli GET <an_object_name>
+ $redis-cli GET <next_object_id>
2
- $redis-cli GET <another_object_name>
+ $redis-cli GET <another_next_object_Id>
1
### Discussion
Please sign in to comment.
Something went wrong with that request. Please try again.