Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIENT-2856] Docs: Clarify how map policy works for all map operations that use it #614

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions aerospike_helpers/operations/map_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,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.
Server sets map policy attributes. Server does not return a value.
juliannguyen4 marked this conversation as resolved.
Show resolved Hide resolved

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 @@ -106,7 +107,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 @@ -133,7 +135,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 @@ -176,7 +179,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 @@ -204,7 +208,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
Loading