Skip to content

Instantly share code, notes, and snippets.

@rbotzer
Created February 16, 2020 05:41
Show Gist options
  • Save rbotzer/94eeddb2a71ccd5c35512b35c856807e to your computer and use it in GitHub Desktop.
Save rbotzer/94eeddb2a71ccd5c35512b35c856807e to your computer and use it in GitHub Desktop.
# Update a segment's TTL by 5 extra hours
# First, the context for the list increment (path to the TTL)
ctx = [ctxh.cdt_ctx_map_key(segment_id)]
ops = [
lh.list_increment("u", 0, 5, ctx=ctx),
mh.map_get_by_key("u", segment_id, aerospike.MAP_RETURN_KEY_VALUE),
]
print("\nAdd 5 hours to the TTL of user u1's segment {}".format(segment_id))
if options.interactive:
pause()
_, _, b = client.operate(key, ops)
print(b["u"])
print(spacer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment