Skip to content

Commit

Permalink
[CLIENT-2856] Docs: Clarify how map policy works for all map operatio…
Browse files Browse the repository at this point in the history
…ns that use it (#614)

* Add missing default value for persist_index

---------

Co-authored-by: justinlee-aerospike <[email protected]>
  • Loading branch information
juliannguyen4 and justinlee-aerospike authored May 6, 2024
1 parent a53315e commit b89be37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 11 additions & 6 deletions aerospike_helpers/operations/map_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@
def map_set_policy(bin_name: str, policy, ctx: Optional[list] = None):
"""Creates a map_set_policy_operation.
The operation allows a user to set the policy for the map.
This operation sets map policy attributes server-side for the designated map. Server does not return a value.
Args:
bin_name (str): The name of the bin containing the map.
policy (dict): The :ref:`map_policy dictionary <aerospike_map_policies>`.
policy (dict): The :ref:`map_policy dictionary <aerospike_map_policies>`. Note that the "map_write_flags" option
in the map policy will be ignored in this operation.
ctx (list): An optional list of nested CDT :class:`cdt_ctx <aerospike_helpers.cdt_ctx>` context operation
objects.
Returns:
Expand Down Expand Up @@ -110,7 +111,8 @@ def map_put(bin_name: str, key, value, map_policy: Optional[dict] = None, ctx: O
key: The key for the map.
value: The item to store in the map with the corresponding key.
map_policy (dict): Optional :ref:`map_policy dictionary <aerospike_map_policies>` specifies the mode of writing
items to the Map, and dictates the map order if there is no Map at the *bin_name*
items to the Map, and dictates the map order if there is no Map at the *bin_name*. ``"persist_index"``
option is also applied.
ctx (list): An optional list of nested CDT :class:`cdt_ctx <aerospike_helpers.cdt_ctx>` context operation
objects.
Returns:
Expand All @@ -137,7 +139,8 @@ def map_put_items(bin_name: str, item_dict, map_policy: Optional[dict] = None, c
bin_name (str): The name of the bin containing the map.
item_dict (dict): A dictionary of key value pairs to be added to the map on the server.
map_policy (dict): Optional :ref:`map_policy dictionary <aerospike_map_policies>` specifies the mode of writing
items to the Map, and dictates the map order if there is no Map at the *bin_name*
items to the Map, and dictates the map order if there is no Map at the *bin_name*. ``"persist_index"``
option is also applied.
ctx (list): An optional list of nested CDT :class:`cdt_ctx <aerospike_helpers.cdt_ctx>` context operation
objects.
Returns:
Expand Down Expand Up @@ -180,7 +183,8 @@ def map_increment(bin_name: str, key, amount, map_policy: Optional[dict] = None,
key: The key for the value to be incremented.
amount: The amount by which to increment the value stored in map[key]
map_policy (dict): Optional :ref:`map_policy dictionary <aerospike_map_policies>` specifies the mode of writing
items to the Map, and dictates the map order if there is no Map at the *bin_name*
items to the Map, and dictates the map order if there is no Map at the *bin_name*. ``"persist_index"``
option is also applied.
ctx (list): An optional list of nested CDT :class:`cdt_ctx <aerospike_helpers.cdt_ctx>` context operation
objects.
Returns:
Expand Down Expand Up @@ -208,7 +212,8 @@ def map_decrement(bin_name: str, key, amount, map_policy: Optional[dict] = None,
key: The key for the value to be decremented.
amount: The amount by which to decrement the value stored in map[key]
map_policy (dict): Optional :ref:`map_policy dictionary <aerospike_map_policies>` specifies the mode of writing
items to the Map, and dictates the map order if there is no Map at the *bin_name*
items to the Map, and dictates the map order if there is no Map at the *bin_name*. ``"persist_index"``
option is also applied.
ctx (list): An optional list of nested CDT :class:`cdt_ctx <aerospike_helpers.cdt_ctx>` context operation
objects.
Returns:
Expand Down
2 changes: 2 additions & 0 deletions doc/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,8 @@ Map Policies
| If :py:obj:`True`, persist map index. A map index improves lookup performance,
| but requires more storage. A map index can be created for a top-level
| ordered map only. Nested and unordered map indexes are not supported.
|
| Default: :py:obj:`False`
Example:

Expand Down

0 comments on commit b89be37

Please sign in to comment.