All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_map_operations.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2023 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 #pragma once
18 
19 /**
20  * @defgroup map_operations Map Operations
21  * @ingroup client_operations
22  *
23  * Unique key map bin operations. Create map operations used by the client operate command.
24  * The default unique key map is unordered. Valid map key types are:
25  * <ul>
26  * <li>as_string</li>
27  * <li>as_integer</li>
28  * <li>as_bytes</li>
29  * <li>as_list</li>
30  * </ul>
31  *
32  * All maps maintain an index and a rank. The index is the item offset from the start of the map,
33  * for both unordered and ordered maps. The rank is the sorted index of the value component.
34  * Map supports negative indexing for index and rank.
35  *
36  * Index examples:
37  * <ul>
38  * <li>Index 0: First item in map.</li>
39  * <li>Index 4: Fifth item in map.</li>
40  * <li>Index -1: Last item in map.</li>
41  * <li>Index -3: Third to last item in map.</li>
42  * <li>Index 1 Count 2: Second and third items in map.</li>
43  * <li>Index -3 Count 3: Last three items in map.</li>
44  * <li>Index -5 Count 4: Range between fifth to last item to second to last item inclusive.</li>
45  * </ul>
46  *
47  * Rank examples:
48  * <ul>
49  * <li>Rank 0: Item with lowest value rank in map.</li>
50  * <li>Rank 4: Fifth lowest ranked item in map.</li>
51  * <li>Rank -1: Item with highest ranked value in map.</li>
52  * <li>Rank -3: Item with third highest ranked value in map.</li>
53  * <li>Rank 1 Count 2: Second and third lowest ranked items in map.</li>
54  * <li>Rank -3 Count 3: Top three ranked items in map.</li>
55  * </ul>
56  *
57  * Code examples:
58  *
59  * ~~~~~~~~~~{.c}
60  * // bin = {key1=11, key2=22, key3=33}
61  * // Set map value to 11 for map key "key2".
62  * as_operations ops;
63  * as_operations_inita(&ops, 1);
64  *
65  * as_string key;
66  * as_string_init(&key, "key2", false);
67  * as_integer val;
68  * as_integer_init(&val, 11);
69  * as_operations_map_put(&ops, "bin", NULL, NULL, (as_val*)&key, (as_val*)&val);
70  *
71  * as_record* rec = NULL;
72  * as_error err;
73  * aerospike_key_operate(&as, &err, NULL, &key, &ops, &rec);
74  * // bin result = {key1=11, key2=11, key3=33}
75  * as_operations_destroy(&ops);
76  * as_record_destroy(rec);
77  * ~~~~~~~~~~
78  *
79  * Nested CDT operations are supported by optional context (as_cdt_ctx):
80  *
81  * ~~~~~~~~~~{.c}
82  * // bin = {key1={key11=9,key12=4}, key2={key21=3,key22=5}}
83  * // Set map value to 11 for map key "key21" inside of map key "key2".
84  * as_cdt_ctx ctx;
85  * as_cdt_ctx_inita(&ctx, 1);
86  * as_string str;
87  * as_string_init(&str, "key2", false);
88  * as_cdt_ctx_add_map_key(&ctx, (as_val*)&str);
89  *
90  * as_operations ops;
91  * as_operations_inita(&ops, 1);
92  *
93  * as_string key;
94  * as_string_init(&key, "key21", false);
95  * as_integer val;
96  * as_integer_init(&val, 11);
97  * as_operations_map_put(&ops, "bin", &ctx, NULL, (as_val*)&key, (as_val*)&val);
98  *
99  * as_record* rec = NULL;
100  * as_error err;
101  * aerospike_key_operate(&as, &err, NULL, &key, &ops, &rec);
102  * // bin result = {key1={key11=9,key12=4},key2={key21=11,key22=5}}
103  * as_operations_destroy(&ops);
104  * as_record_destroy(rec);
105  * ~~~~~~~~~~
106  */
107 
108 #include <aerospike/as_cdt_order.h>
109 #include <aerospike/as_operations.h>
110 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 
115 /******************************************************************************
116  * TYPES
117  *****************************************************************************/
118 
119 /**
120  * Map write mode.
121  * This enum should only be used for server versions < 4.3.
122  * as_map_write_flags is recommended for server versions >= 4.3.
123  *
124  * @ingroup map_operations
125  */
126 typedef enum as_map_write_mode_e {
127  /**
128  * If the key already exists, the item will be overwritten.
129  * If the key does not exist, a new item will be created.
130  */
132 
133  /**
134  * If the key already exists, the item will be overwritten.
135  * If the key does not exist, the write will fail.
136  */
138 
139  /**
140  * If the key already exists, the write will fail.
141  * If the key does not exist, a new item will be created.
142  */
145 
146 /**
147  * Map write bit flags.
148  * Requires server versions >= 4.3.
149  *
150  * @ingroup map_operations
151  */
152 typedef enum as_map_write_flags_e {
153  /**
154  * Default. Allow create or update.
155  */
157 
158  /**
159  * If the key already exists, the item will be denied.
160  * If the key does not exist, a new item will be created.
161  */
163 
164  /**
165  * If the key already exists, the item will be overwritten.
166  * If the key does not exist, the item will be denied.
167  */
169 
170  /**
171  * Do not raise error if a map item is denied due to write flag constraints.
172  */
174 
175  /**
176  * Allow other valid map items to be committed if a map item is denied due to
177  * write flag constraints.
178  */
181 
182 /**
183  * Map policy directives when creating a map and writing map items.
184  *
185  * @ingroup map_operations
186  */
187 typedef struct as_map_policy_s {
188  uint64_t attributes;
189  uint64_t flags;
192 } as_map_policy;
193 
194 /**
195  * Map return type. Type of data to return when selecting or removing items from the map.
196  *
197  * @ingroup map_operations
198  */
199 typedef enum as_map_return_type_e {
200  /**
201  * Do not return a result.
202  */
204 
205  /**
206  * Return key index order.
207  */
209 
210  /**
211  * Return reverse key order.
212  */
214 
215  /**
216  * Return value order.
217  */
219 
220  /**
221  * Return reverse value order.
222  */
224 
225  /**
226  * Return count of items selected.
227  */
229 
230  /**
231  * Return key for single key read and key list for range read.
232  */
234 
235  /**
236  * Return value for single key read and value list for range read.
237  */
239 
240  /**
241  * Return key/value items.
242  */
244 
245  /**
246  * Return true if count > 0.
247  */
249 
250  /**
251  * Return an unordered map.
252  */
254 
255  /**
256  * Return an ordered map.
257  */
259 
260  /**
261  * Invert meaning of map command and return values. For example:
262  *
263  * ~~~~~~~~~~{.c}
264  * as_operations ops;
265  * as_operations_inita(&ops, 1);
266  *
267  * as_operations_add_map_remove_by_key_range(&ops, BIN_NAME, (as_val*)&mkey1, (as_val*)&mkey2,
268  * AS_MAP_RETURN_KEY | AS_MAP_RETURN_INVERTED);
269  *
270  * as_record* rec = NULL;
271  * as_status status = aerospike_key_operate(as, &err, NULL, &key, &ops, &rec);
272  * as_operations_destroy(&ops);
273  * ~~~~~~~~~~
274  *
275  * With AS_MAP_RETURN_INVERTED enabled, the keys outside of the specified key range will be
276  * removed and returned.
277  */
280 
281 /**
282  * @private
283  * Map operation codes.
284  */
285 typedef enum {
321 } as_cdt_op_map;
322 
323 /******************************************************************************
324  * FUNCTIONS
325  *****************************************************************************/
326 
327 /**
328  * Initialize map attributes to default unordered map with standard overwrite semantics.
329  *
330  * @ingroup map_operations
331  */
332 AS_EXTERN void
334 
335 /**
336  * Set map attributes to specified map order and write mode semantics.
337  *
338  * This function should only be used for server versions < 4.3.
339  * #as_map_policy_set_flags is recommended for server versions >= 4.3.
340  *
341  * @ingroup map_operations
342  */
343 AS_EXTERN void
345 
346 /**
347  * Set map attributes to specified map order and write flags (See as_map_write_flags).
348  *
349  * @ingroup map_operations
350  */
351 AS_EXTERN void
352 as_map_policy_set_flags(as_map_policy* policy, as_map_order order, uint32_t flags);
353 
354 /**
355  * Set map attributes to specified map order, write flags and whether to persist the map index.
356  *
357  * @param policy Target map policy.
358  * @param order Map order.
359  * @param flags Map write flags. See as_map_write_flags.
360  * @param persist_index If true, persist map index. A map index improves lookup performance,
361  * but requires more storage. A map index can be created for a top-level
362  * ordered map only. Nested and unordered map indexes are not supported.
363  *
364  * @ingroup map_operations
365  */
366 AS_EXTERN void
367 as_map_policy_set_all(as_map_policy* policy, as_map_order order, uint32_t flags, bool persist_index);
368 
369 /**
370  * Create map create operation.
371  * Server creates map at given context level.
372  *
373  * @ingroup map_operations
374  */
375 AS_EXTERN bool
377  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_order order
378  );
379 
380 /**
381  * Create map create operation.
382  * Server creates map at given context level.
383  *
384  * @param ops Target operations list.
385  * @param name Bin name.
386  * @param ctx Optional path to nested map. If not defined, the top-level map is used.
387  * @param order Map order.
388  * @param persist_index If true, persist map index. A map index improves lookup performance,
389  * but requires more storage. A map index can be created for a top-level
390  * ordered map only. Nested and unordered map indexes are not supported.
391  *
392  * @ingroup map_operations
393  */
394 AS_EXTERN bool
396  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_order order, bool persist_index
397  );
398 
399 /**
400  * Create set map policy operation.
401  * Server sets map policy attributes. Server does not return a value.
402  *
403  * @ingroup map_operations
404  */
405 AS_EXTERN bool
407  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_policy* policy
408  );
409 
410 /**
411  * Create map put operation.
412  * Server writes key/value item to map bin and returns map size.
413  *
414  * The required map policy dictates the type of map to create when it does not exist.
415  * The map policy also specifies the mode used when writing items to the map.
416  * See `as_map_policy` and `as_map_write_mode`.
417  *
418  * This function takes ownership and frees heap memory associated with key/value parameters.
419  * @ingroup map_operations
420  */
421 AS_EXTERN bool
423  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_policy* policy,
424  as_val* key, as_val* value
425  );
426 
427 /**
428  * Create map put items operation.
429  * Server writes each map item to map bin and returns map size.
430  *
431  * The required map policy dictates the type of map to create when it does not exist.
432  * The map policy also specifies the mode used when writing items to the map.
433  * See `as_map_policy` and `as_map_write_mode`.
434  *
435  * This function takes ownership and frees heap memory associated with items parameter.
436  * @ingroup map_operations
437  */
438 AS_EXTERN bool
440  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_policy* policy,
441  as_map* items
442  );
443 
444 /**
445  * Create map increment operation.
446  * Server increments values by incr for all items identified by key and returns final result.
447  * Valid only for numbers.
448  *
449  * The required map policy dictates the type of map to create when it does not exist.
450  * The map policy also specifies the mode used when writing items to the map.
451  * See `as_map_policy` and `as_map_write_mode`.
452  *
453  * This function takes ownership and frees heap memory associated with key/value parameters.
454  * @ingroup map_operations
455  */
456 AS_EXTERN bool
458  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_policy* policy, as_val* key,
459  as_val* value
460  );
461 
462 /**
463  * Create map decrement operation.
464  * Server decrement values by decr for all items identified by key and returns final result.
465  * Valid only for numbers.
466  *
467  * The required map policy dictates the type of map to create when it does not exist.
468  * The map policy also specifies the mode used when writing items to the map.
469  * See `as_map_policy` and `as_map_write_mode`.
470  *
471  * This function takes ownership and frees heap memory associated with key/value parameters.
472  *
473  * @deprecated Use as_operations_map_increment() with negative value instead.
474  * @ingroup map_operations
475  */
476 AS_EXTERN bool
478  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_policy* policy, as_val* key,
479  as_val* value
480  );
481 
482 /**
483  * Create map clear operation.
484  * Server removes all items in map. Server returns null.
485  *
486  * @ingroup map_operations
487  */
488 AS_EXTERN bool
489 as_operations_map_clear(as_operations* ops, const char* name, as_cdt_ctx* ctx);
490 
491 /**
492  * Create map remove operation.
493  * Server removes map item identified by key and returns removed data specified by return_type.
494  *
495  * This function takes ownership and frees heap memory associated with key parameter.
496  * @ingroup map_operations
497  */
498 AS_EXTERN bool
500  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* key,
501  as_map_return_type return_type
502  );
503 
504 /**
505  * Create map remove operation.
506  * Server removes map items identified by keys and returns removed data specified by return_type.
507  *
508  * This function takes ownership and frees heap memory associated with keys parameter.
509  * @ingroup map_operations
510  */
511 AS_EXTERN bool
513  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_list* keys,
514  as_map_return_type return_type
515  );
516 
517 /**
518  * Create map remove operation.
519  * Server removes map items identified by key range (begin inclusive, end exclusive).
520  * If begin is null, the range is less than end.
521  * If end is null, the range is greater than equal to begin.
522  *
523  * Server returns removed data specified by return_type.
524  *
525  * This function takes ownership and frees heap memory associated with begin/end parameters.
526  * @ingroup map_operations
527  */
528 AS_EXTERN bool
530  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* begin, as_val* end,
531  as_map_return_type return_type
532  );
533 
534 /**
535  * Create map remove by key relative to index range operation.
536  * Server removes map items nearest to key and greater by index.
537  * Server returns removed data specified by return_type.
538  *
539  * Examples for map [{0=17},{4=2},{5=15},{9=10}]:
540  * <ul>
541  * <li>(value,index) = [removed items]</li>
542  * <li>(5,0) = [{5=15},{9=10}]</li>
543  * <li>(5,1) = [{9=10}]</li>
544  * <li>(5,-1) = [{4=2},{5=15},{9=10}]</li>
545  * <li>(3,2) = [{9=10}]</li>
546  * <li>(3,-2) = [{0=17},{4=2},{5=15},{9=10}]</li>
547  * </ul>
548  *
549  * This function takes ownership and frees heap memory associated with key parameter.
550  * @ingroup map_operations
551  */
552 AS_EXTERN bool
554  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* key, int64_t index,
555  as_map_return_type return_type
556  );
557 
558 /**
559  * Create map remove by key relative to index range operation.
560  * Server removes map items nearest to key and greater by index with a count limit.
561  * Server returns removed data specified by return_type.
562  *
563  * Examples for map [{0=17},{4=2},{5=15},{9=10}]:
564  * <ul>
565  * <li>(value,index,count) = [removed items]</li>
566  * <li>(5,0,1) = [{5=15}]</li>
567  * <li>(5,1,2) = [{9=10}]</li>
568  * <li>(5,-1,1) = [{4=2}]</li>
569  * <li>(3,2,1) = [{9=10}]</li>
570  * <li>(3,-2,2) = [{0=17}]</li>
571  * </ul>
572  *
573  * This function takes ownership and frees heap memory associated with key parameter.
574  * @ingroup map_operations
575  */
576 AS_EXTERN bool
578  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* key, int64_t index,
579  uint64_t count, as_map_return_type return_type
580  );
581 
582 /**
583  * Create map remove operation.
584  * Server removes map items identified by value and returns removed data specified by return_type.
585  *
586  * This function takes ownership and frees heap memory associated with value parameter.
587  * @ingroup map_operations
588  */
589 AS_EXTERN bool
591  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* value,
592  as_map_return_type return_type
593  );
594 
595 /**
596  * Create map remove operation.
597  * Server removes map items identified by values and returns removed data specified by return_type.
598  *
599  * This function takes ownership and frees heap memory associated with values parameter.
600  * @ingroup map_operations
601  */
602 AS_EXTERN bool
604  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_list* values,
605  as_map_return_type return_type
606  );
607 
608 /**
609  * Create map remove operation.
610  * Server removes map items identified by value range (begin inclusive, end exclusive).
611  * If begin is null, the range is less than end.
612  * If end is null, the range is greater than equal to begin.
613  *
614  * Server returns removed data specified by return_type.
615  *
616  * This function takes ownership and frees heap memory associated with begin/end parameters.
617  * @ingroup map_operations
618  */
619 AS_EXTERN bool
621  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* begin, as_val* end,
622  as_map_return_type return_type
623  );
624 
625 /**
626  * Create map remove by value relative to rank range operation.
627  * Server removes map items nearest to value and greater by relative rank.
628  * Server returns removed data specified by return_type.
629  *
630  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
631  * <ul>
632  * <li>(value,rank) = [removed items]</li>
633  * <li>(11,1) = [{0=17}]</li>
634  * <li>(11,-1) = [{9=10},{5=15},{0=17}]</li>
635  * </ul>
636  *
637  * This function takes ownership and frees heap memory associated with value parameter.
638  * @ingroup map_operations
639  */
640 AS_EXTERN bool
642  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* value, int64_t rank,
643  as_map_return_type return_type
644  );
645 
646 /**
647  * Create map remove by value relative to rank range operation.
648  * Server removes map items nearest to value and greater by relative rank with a count limit.
649  * Server returns removed data specified by return_type.
650  *
651  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
652  * <ul>
653  * <li>(value,rank,count) = [removed items]</li>
654  * <li>(11,1,1) = [{0=17}]</li>
655  * <li>(11,-1,1) = [{9=10}]</li>
656  * </ul>
657  *
658  * This function takes ownership and frees heap memory associated with value parameter.
659  * @ingroup map_operations
660  */
661 AS_EXTERN bool
663  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* value, int64_t rank,
664  uint64_t count, as_map_return_type return_type
665  );
666 
667 /**
668  * Create map remove operation.
669  * Server removes map item identified by index and returns removed data specified by return_type.
670  *
671  * @ingroup map_operations
672  */
673 AS_EXTERN bool
675  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t index,
676  as_map_return_type return_type
677  );
678 
679 /**
680  * Create map remove operation.
681  * Server removes map items starting at specified index to the end of map and returns removed
682  * data specified by return_type.
683  *
684  * @ingroup map_operations
685  */
686 AS_EXTERN bool
688  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t index,
689  as_map_return_type return_type
690  );
691 
692 /**
693  * Create map remove operation.
694  * Server removes `count` map items starting at specified index and returns removed data specified
695  * by return_type.
696  *
697  * @ingroup map_operations
698  */
699 AS_EXTERN bool
701  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t index, uint64_t count,
702  as_map_return_type return_type
703  );
704 
705 /**
706  * Create map remove operation.
707  * Server removes map item identified by rank and returns removed data specified by return_type.
708  *
709  * @ingroup map_operations
710  */
711 AS_EXTERN bool
713  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t rank,
714  as_map_return_type return_type
715  );
716 
717 /**
718  * Create map remove operation.
719  * Server removes map items starting at specified rank to the last ranked item and returns removed
720  * data specified by return_type.
721  *
722  * @ingroup map_operations
723  */
724 AS_EXTERN bool
726  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t rank,
727  as_map_return_type return_type
728  );
729 
730 /**
731  * Create map remove operation.
732  * Server removes `count` map items starting at specified rank and returns removed data specified by
733  * return_type.
734  *
735  * @ingroup map_operations
736  */
737 AS_EXTERN bool
739  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t rank, uint64_t count,
740  as_map_return_type return_type
741  );
742 
743 /**
744  * Create map size operation.
745  * Server returns size of map.
746  *
747  * @ingroup map_operations
748  */
749 AS_EXTERN bool
750 as_operations_map_size(as_operations* ops, const char* name, as_cdt_ctx* ctx);
751 
752 /**
753  * Create map get by key operation.
754  * Server selects map item identified by key and returns selected data specified by return_type.
755  *
756  * This function takes ownership and frees heap memory associated with key parameter.
757  * @ingroup map_operations
758  */
759 AS_EXTERN bool
761  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* key,
762  as_map_return_type return_type
763  );
764 
765 /**
766  * Create map get by key range operation.
767  * Server selects map items identified by key range (begin inclusive, end exclusive).
768  * If begin is null, the range is less than end.
769  * If end is null, the range is greater than equal to begin.
770  *
771  * Server returns selected data specified by return_type.
772  *
773  * This function takes ownership and frees heap memory associated with begin/end parameters.
774  * @ingroup map_operations
775  */
776 AS_EXTERN bool
778  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* begin, as_val* end,
779  as_map_return_type return_type
780  );
781 
782 /**
783  * Create map get by key list operation.
784  * Server selects map items identified by keys and returns selected data specified by return_type.
785  *
786  * This function takes ownership and frees heap memory associated with keys parameter.
787  * @ingroup map_operations
788  */
789 AS_EXTERN bool
791  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_list* keys,
792  as_map_return_type return_type
793  );
794 
795 /**
796  * Create map get by key relative to index range operation.
797  * Server selects map items nearest to key and greater by index.
798  * Server returns selected data specified by return_type.
799  *
800  * Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
801  * <ul>
802  * <li>(value,index) = [selected items]</li>
803  * <li>(5,0) = [{5=15},{9=10}]</li>
804  * <li>(5,1) = [{9=10}]</li>
805  * <li>(5,-1) = [{4=2},{5=15},{9=10}]</li>
806  * <li>(3,2) = [{9=10}]</li>
807  * <li>(3,-2) = [{0=17},{4=2},{5=15},{9=10}]</li>
808  * </ul>
809  *
810  * This function takes ownership and frees heap memory associated with key parameter.
811  * @ingroup map_operations
812  */
813 AS_EXTERN bool
815  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* key, int64_t index,
816  as_map_return_type return_type
817  );
818 
819 /**
820  * Create map get by key relative to index range operation.
821  * Server selects map items nearest to key and greater by index with a count limit.
822  * Server returns selected data specified by return_type.
823  *
824  * Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
825  * <ul>
826  * <li>(value,index,count) = [selected items]</li>
827  * <li>(5,0,1) = [{5=15}]</li>
828  * <li>(5,1,2) = [{9=10}]</li>
829  * <li>(5,-1,1) = [{4=2}]</li>
830  * <li>(3,2,1) = [{9=10}]</li>
831  * <li>(3,-2,2) = [{0=17}]</li>
832  * </ul>
833  *
834  * This function takes ownership and frees heap memory associated with key parameter.
835  * @ingroup map_operations
836  */
837 AS_EXTERN bool
839  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* key, int64_t index,
840  uint64_t count, as_map_return_type return_type
841  );
842 
843 /**
844  * Create map get by value operation.
845  * Server selects map items identified by value and returns selected data specified by return_type.
846  *
847  * This function takes ownership and frees heap memory associated with value parameter.
848  * @ingroup map_operations
849  */
850 AS_EXTERN bool
852  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* value,
853  as_map_return_type return_type
854  );
855 
856 /**
857  * Create map get by value range operation.
858  * Server selects map items identified by value range (begin inclusive, end exclusive).
859  * If begin is null, the range is less than end.
860  * If end is null, the range is greater than equal to begin.
861  *
862  * Server returns selected data specified by return_type.
863  *
864  * This function takes ownership and frees heap memory associated with begin/end parameters.
865  * @ingroup map_operations
866  */
867 AS_EXTERN bool
869  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* begin, as_val* end,
870  as_map_return_type return_type
871  );
872 
873 /**
874  * Create map get by value list operation.
875  * Server selects map items identified by values and returns selected data specified by return_type.
876  *
877  * This function takes ownership and frees heap memory associated with values parameter.
878  * @ingroup map_operations
879  */
880 AS_EXTERN bool
882  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_list* values,
883  as_map_return_type return_type
884  );
885 
886 /**
887  * Create map get by value relative to rank range operation.
888  * Server selects map items nearest to value and greater by relative rank.
889  * Server returns selected data specified by return_type.
890  *
891  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
892  * <ul>
893  * <li>(value,rank) = [selected items]</li>
894  * <li>(11,1) = [{0=17}]</li>
895  * <li>(11,-1) = [{9=10},{5=15},{0=17}]</li>
896  * </ul>
897  *
898  * This function takes ownership and frees heap memory associated with value parameter.
899  * @ingroup map_operations
900  */
901 AS_EXTERN bool
903  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* value, int64_t rank,
904  as_map_return_type return_type
905  );
906 
907 /**
908  * Create map get by value relative to rank range operation.
909  * Server selects map items nearest to value and greater by relative rank with a count limit.
910  * Server returns selected data specified by return_type.
911  *
912  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
913  * <ul>
914  * <li>(value,rank,count) = [selected items]</li>
915  * <li>(11,1,1) = [{0=17}]</li>
916  * <li>(11,-1,1) = [{9=10}]</li>
917  * </ul>
918  *
919  * This function takes ownership and frees heap memory associated with value parameter.
920  * @ingroup map_operations
921  */
922 AS_EXTERN bool
924  as_operations* ops, const char* name, as_cdt_ctx* ctx, as_val* value, int64_t rank,
925  uint64_t count, as_map_return_type return_type
926  );
927 
928 /**
929  * Create map get by index operation.
930  * Server selects map item identified by index and returns selected data specified by return_type.
931  *
932  * @ingroup map_operations
933  */
934 AS_EXTERN bool
936  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t index,
937  as_map_return_type return_type
938  );
939 
940 /**
941  * Create map get by index range operation.
942  * Server selects map items starting at specified index to the end of map and returns selected
943  * data specified by return_type.
944  *
945  * @ingroup map_operations
946  */
947 AS_EXTERN bool
949  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t index,
950  as_map_return_type return_type
951  );
952 
953 /**
954  * Create map get by index range operation.
955  * Server selects `count` map items starting at specified index and returns selected data specified
956  * by return_type.
957  *
958  * @ingroup map_operations
959  */
960 AS_EXTERN bool
962  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t index, uint64_t count,
963  as_map_return_type return_type
964  );
965 
966 /**
967  * Create map get by rank operation.
968  * Server selects map item identified by rank and returns selected data specified by return_type.
969  *
970  * @ingroup map_operations
971  */
972 AS_EXTERN bool
974  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t rank,
975  as_map_return_type return_type
976  );
977 
978 /**
979  * Create map get by rank range operation.
980  * Server selects map items starting at specified rank to the last ranked item and returns selected
981  * data specified by return_type.
982  *
983  * @ingroup map_operations
984  */
985 AS_EXTERN bool
987  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t rank,
988  as_map_return_type return_type
989  );
990 
991 /**
992  * Create map get by rank range operation.
993  * Server selects `count` map items starting at specified rank and returns selected data specified
994  * by return_type.
995  *
996  * @ingroup map_operations
997  */
998 AS_EXTERN bool
1000  as_operations* ops, const char* name, as_cdt_ctx* ctx, int64_t rank, uint64_t count,
1001  as_map_return_type return_type
1002  );
1003 
1004 /******************************************************************************
1005  * LEGACY FUNCTIONS
1006  *****************************************************************************/
1007 
1008 /**
1009  * Create set map policy operation.
1010  * Server sets map policy attributes. Server does not return a value.
1011  *
1012  * @ingroup map_operations
1013  */
1014 static inline bool
1016 {
1017  return as_operations_map_set_policy(ops, name, NULL, policy);
1018 }
1019 
1020 /**
1021  * Create map put operation.
1022  * Server writes key/value item to map bin and returns map size.
1023  *
1024  * The required map policy dictates the type of map to create when it does not exist.
1025  * The map policy also specifies the mode used when writing items to the map.
1026  * See `as_map_policy` and `as_map_write_mode`.
1027  *
1028  * @ingroup map_operations
1029  */
1030 static inline bool
1032  as_operations* ops, const char* name, as_map_policy* policy, as_val* key, as_val* value
1033  )
1034 {
1035  return as_operations_map_put(ops, name, NULL, policy, key, value);
1036 }
1037 
1038 /**
1039  * Create map put items operation.
1040  * Server writes each map item to map bin and returns map size.
1041  *
1042  * The required map policy dictates the type of map to create when it does not exist.
1043  * The map policy also specifies the mode used when writing items to the map.
1044  * See `as_map_policy` and `as_map_write_mode`.
1045  *
1046  * @ingroup map_operations
1047  */
1048 static inline bool
1050  as_operations* ops, const char* name, as_map_policy* policy, as_map* items
1051  )
1052 {
1053  return as_operations_map_put_items(ops, name, NULL, policy, items);
1054 }
1055 
1056 /**
1057  * Create map increment operation.
1058  * Server increments values by incr for all items identified by key and returns final result.
1059  * Valid only for numbers.
1060  *
1061  * The required map policy dictates the type of map to create when it does not exist.
1062  * The map policy also specifies the mode used when writing items to the map.
1063  * See `as_map_policy` and `as_map_write_mode`.
1064  *
1065  * @ingroup map_operations
1066  */
1067 static inline bool
1069  as_operations* ops, const char* name, as_map_policy* policy, as_val* key, as_val* value
1070  )
1071 {
1072  return as_operations_map_increment(ops, name, NULL, policy, key, value);
1073 }
1074 
1075 /**
1076  * Create map decrement operation.
1077  * Server decrement values by decr for all items identified by key and returns final result.
1078  * Valid only for numbers.
1079  *
1080  * The required map policy dictates the type of map to create when it does not exist.
1081  * The map policy also specifies the mode used when writing items to the map.
1082  * See `as_map_policy` and `as_map_write_mode`.
1083  *
1084  * @ingroup map_operations
1085  */
1086 static inline bool
1088  as_operations* ops, const char* name, as_map_policy* policy, as_val* key, as_val* value
1089  )
1090 {
1091  return as_operations_map_decrement(ops, name, NULL, policy, key, value);
1092 }
1093 
1094 /**
1095  * Create map clear operation.
1096  * Server removes all items in map. Server returns null.
1097  *
1098  * @ingroup map_operations
1099  */
1100 static inline bool
1102 {
1103  return as_operations_map_clear(ops, name, NULL);
1104 }
1105 
1106 /**
1107  * Create map remove operation.
1108  * Server removes map item identified by key and returns removed data specified by return_type.
1109  *
1110  * @ingroup map_operations
1111  */
1112 static inline bool
1114  as_operations* ops, const char* name, as_val* key, as_map_return_type return_type
1115  )
1116 {
1117  return as_operations_map_remove_by_key(ops, name, NULL, key, return_type);
1118 }
1119 
1120 /**
1121  * Create map remove operation.
1122  * Server removes map items identified by keys and returns removed data specified by return_type.
1123  *
1124  * @ingroup map_operations
1125  */
1126 static inline bool
1128  as_operations* ops, const char* name, as_list* keys, as_map_return_type return_type
1129  )
1130 {
1131  return as_operations_map_remove_by_key_list(ops, name, NULL, keys, return_type);
1132 }
1133 
1134 /**
1135  * Create map remove operation.
1136  * Server removes map items identified by key range (begin inclusive, end exclusive).
1137  * If begin is null, the range is less than end.
1138  * If end is null, the range is greater than equal to begin.
1139  *
1140  * Server returns removed data specified by return_type.
1141  *
1142  * @ingroup map_operations
1143  */
1144 static inline bool
1146  as_operations* ops, const char* name, as_val* begin, as_val* end,
1147  as_map_return_type return_type
1148  )
1149 {
1150  return as_operations_map_remove_by_key_range(ops, name, NULL, begin, end, return_type);
1151 }
1152 
1153 /**
1154  * Create map remove by key relative to index range operation.
1155  * Server removes map items nearest to key and greater by index.
1156  * Server returns removed data specified by return_type.
1157  *
1158  * Examples for map [{0=17},{4=2},{5=15},{9=10}]:
1159  * <ul>
1160  * <li>(value,index) = [removed items]</li>
1161  * <li>(5,0) = [{5=15},{9=10}]</li>
1162  * <li>(5,1) = [{9=10}]</li>
1163  * <li>(5,-1) = [{4=2},{5=15},{9=10}]</li>
1164  * <li>(3,2) = [{9=10}]</li>
1165  * <li>(3,-2) = [{0=17},{4=2},{5=15},{9=10}]</li>
1166  * </ul>
1167  *
1168  * @ingroup map_operations
1169  */
1170 static inline bool
1172  as_operations* ops, const char* name, as_val* key, int64_t index,
1173  as_map_return_type return_type
1174  )
1175 {
1176  return as_operations_map_remove_by_key_rel_index_range_to_end(ops, name, NULL, key, index, return_type);
1177 }
1178 
1179 /**
1180  * Create map remove by key relative to index range operation.
1181  * Server removes map items nearest to key and greater by index with a count limit.
1182  * Server returns removed data specified by return_type.
1183  *
1184  * Examples for map [{0=17},{4=2},{5=15},{9=10}]:
1185  * <ul>
1186  * <li>(value,index,count) = [removed items]</li>
1187  * <li>(5,0,1) = [{5=15}]</li>
1188  * <li>(5,1,2) = [{9=10}]</li>
1189  * <li>(5,-1,1) = [{4=2}]</li>
1190  * <li>(3,2,1) = [{9=10}]</li>
1191  * <li>(3,-2,2) = [{0=17}]</li>
1192  * </ul>
1193  *
1194  * @ingroup map_operations
1195  */
1196 static inline bool
1198  as_operations* ops, const char* name, as_val* key, int64_t index, uint64_t count,
1199  as_map_return_type return_type
1200  )
1201 {
1202  return as_operations_map_remove_by_key_rel_index_range(ops, name, NULL, key, index, count,
1203  return_type);
1204 }
1205 
1206 /**
1207  * Create map remove operation.
1208  * Server removes map items identified by value and returns removed data specified by return_type.
1209  *
1210  * @ingroup map_operations
1211  */
1212 static inline bool
1214  as_operations* ops, const char* name, as_val* value, as_map_return_type return_type
1215  )
1216 {
1217  return as_operations_map_remove_by_value(ops, name, NULL, value, return_type);
1218 }
1219 
1220 /**
1221  * Create map remove operation.
1222  * Server removes map items identified by values and returns removed data specified by return_type.
1223  *
1224  * @ingroup map_operations
1225  */
1226 static inline bool
1228  as_operations* ops, const char* name, as_list* values, as_map_return_type return_type
1229  )
1230 {
1231  return as_operations_map_remove_by_value_list(ops, name, NULL, values, return_type);
1232 }
1233 
1234 /**
1235  * Create map remove operation.
1236  * Server removes map items identified by value range (begin inclusive, end exclusive).
1237  * If begin is null, the range is less than end.
1238  * If end is null, the range is greater than equal to begin.
1239  *
1240  * Server returns removed data specified by return_type.
1241  *
1242  * @ingroup map_operations
1243  */
1244 static inline bool
1246  as_operations* ops, const char* name, as_val* begin, as_val* end,
1247  as_map_return_type return_type
1248  )
1249 {
1250  return as_operations_map_remove_by_value_range(ops, name, NULL, begin, end, return_type);
1251 }
1252 
1253 /**
1254  * Create map remove by value relative to rank range operation.
1255  * Server removes map items nearest to value and greater by relative rank.
1256  * Server returns removed data specified by return_type.
1257  *
1258  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
1259  * <ul>
1260  * <li>(value,rank) = [removed items]</li>
1261  * <li>(11,1) = [{0=17}]</li>
1262  * <li>(11,-1) = [{9=10},{5=15},{0=17}]</li>
1263  * </ul>
1264  *
1265  * @ingroup map_operations
1266  */
1267 static inline bool
1269  as_operations* ops, const char* name, as_val* value, int64_t rank,
1270  as_map_return_type return_type
1271  )
1272 {
1273  return as_operations_map_remove_by_value_rel_rank_range_to_end(ops, name, NULL, value, rank,
1274  return_type);
1275 }
1276 
1277 /**
1278  * Create map remove by value relative to rank range operation.
1279  * Server removes map items nearest to value and greater by relative rank with a count limit.
1280  * Server returns removed data specified by return_type.
1281  *
1282  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
1283  * <ul>
1284  * <li>(value,rank,count) = [removed items]</li>
1285  * <li>(11,1,1) = [{0=17}]</li>
1286  * <li>(11,-1,1) = [{9=10}]</li>
1287  * </ul>
1288  *
1289  * @ingroup map_operations
1290  */
1291 static inline bool
1293  as_operations* ops, const char* name, as_val* value, int64_t rank, uint64_t count,
1294  as_map_return_type return_type
1295  )
1296 {
1297  return as_operations_map_remove_by_value_rel_rank_range(ops, name, NULL, value, rank, count,
1298  return_type);
1299 }
1300 
1301 /**
1302  * Create map remove operation.
1303  * Server removes map item identified by index and returns removed data specified by return_type.
1304  *
1305  * @ingroup map_operations
1306  */
1307 static inline bool
1309  as_operations* ops, const char* name, int64_t index, as_map_return_type return_type
1310  )
1311 {
1312  return as_operations_map_remove_by_index(ops, name, NULL, index, return_type);
1313 }
1314 
1315 /**
1316  * Create map remove operation.
1317  * Server removes map items starting at specified index to the end of map and returns removed
1318  * data specified by return_type.
1319  *
1320  * @ingroup map_operations
1321  */
1322 static inline bool
1324  as_operations* ops, const char* name, int64_t index, as_map_return_type return_type
1325  )
1326 {
1327  return as_operations_map_remove_by_index_range_to_end(ops, name, NULL, index, return_type);
1328 }
1329 
1330 /**
1331  * Create map remove operation.
1332  * Server removes `count` map items starting at specified index and returns removed data specified
1333  * by return_type.
1334  *
1335  * @ingroup map_operations
1336  */
1337 static inline bool
1339  as_operations* ops, const char* name, int64_t index, uint64_t count,
1340  as_map_return_type return_type
1341  )
1342 {
1343  return as_operations_map_remove_by_index_range(ops, name, NULL, index, count, return_type);
1344 }
1345 
1346 /**
1347  * Create map remove operation.
1348  * Server removes map item identified by rank and returns removed data specified by return_type.
1349  *
1350  * @ingroup map_operations
1351  */
1352 static inline bool
1354  as_operations* ops, const char* name, int64_t rank, as_map_return_type return_type
1355  )
1356 {
1357  return as_operations_map_remove_by_rank(ops, name, NULL, rank, return_type);
1358 }
1359 
1360 /**
1361  * Create map remove operation.
1362  * Server removes map items starting at specified rank to the last ranked item and returns removed
1363  * data specified by return_type.
1364  *
1365  * @ingroup map_operations
1366  */
1367 static inline bool
1369  as_operations* ops, const char* name, int64_t rank, as_map_return_type return_type
1370  )
1371 {
1372  return as_operations_map_remove_by_rank_range_to_end(ops, name, NULL, rank, return_type);
1373 }
1374 
1375 /**
1376  * Create map remove operation.
1377  * Server removes `count` map items starting at specified rank and returns removed data specified by
1378  * return_type.
1379  *
1380  * @ingroup map_operations
1381  */
1382 static inline bool
1384  as_operations* ops, const char* name, int64_t rank, uint64_t count,
1385  as_map_return_type return_type
1386  )
1387 {
1388  return as_operations_map_remove_by_rank_range(ops, name, NULL, rank, count, return_type);
1389 }
1390 
1391 /**
1392  * Create map size operation.
1393  * Server returns size of map.
1394  *
1395  * @ingroup map_operations
1396  */
1397 static inline bool
1399 {
1400  return as_operations_map_size(ops, name, NULL);
1401 }
1402 
1403 /**
1404  * Create map get by key operation.
1405  * Server selects map item identified by key and returns selected data specified by return_type.
1406  *
1407  * @ingroup map_operations
1408  */
1409 static inline bool
1411  as_operations* ops, const char* name, as_val* key, as_map_return_type return_type
1412  )
1413 {
1414  return as_operations_map_get_by_key(ops, name, NULL, key, return_type);
1415 }
1416 
1417 /**
1418  * Create map get by key range operation.
1419  * Server selects map items identified by key range (begin inclusive, end exclusive).
1420  * If begin is null, the range is less than end.
1421  * If end is null, the range is greater than equal to begin.
1422  *
1423  * Server returns selected data specified by return_type.
1424  *
1425  * @ingroup map_operations
1426  */
1427 static inline bool
1429  as_operations* ops, const char* name, as_val* begin, as_val* end,
1430  as_map_return_type return_type
1431  )
1432 {
1433  return as_operations_map_get_by_key_range(ops, name, NULL, begin, end, return_type);
1434 }
1435 
1436 /**
1437  * Create map get by key list operation.
1438  * Server selects map items identified by keys and returns selected data specified by return_type.
1439  *
1440  * @ingroup map_operations
1441  */
1442 static inline bool
1444  as_operations* ops, const char* name, as_list* keys, as_map_return_type return_type
1445  )
1446 {
1447  return as_operations_map_get_by_key_list(ops, name, NULL, keys, return_type);
1448 }
1449 
1450 /**
1451  * Create map get by key relative to index range operation.
1452  * Server selects map items nearest to key and greater by index.
1453  * Server returns selected data specified by return_type.
1454  *
1455  * Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
1456  * <ul>
1457  * <li>(value,index) = [selected items]</li>
1458  * <li>(5,0) = [{5=15},{9=10}]</li>
1459  * <li>(5,1) = [{9=10}]</li>
1460  * <li>(5,-1) = [{4=2},{5=15},{9=10}]</li>
1461  * <li>(3,2) = [{9=10}]</li>
1462  * <li>(3,-2) = [{0=17},{4=2},{5=15},{9=10}]</li>
1463  * </ul>
1464  *
1465  * @ingroup map_operations
1466  */
1467 static inline bool
1469  as_operations* ops, const char* name, as_val* key, int64_t index,
1470  as_map_return_type return_type
1471  )
1472 {
1473  return as_operations_map_get_by_key_rel_index_range_to_end(ops, name, NULL, key, index,
1474  return_type);
1475 }
1476 
1477 /**
1478  * Create map get by key relative to index range operation.
1479  * Server selects map items nearest to key and greater by index with a count limit.
1480  * Server returns selected data specified by return_type.
1481  *
1482  * Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
1483  * <ul>
1484  * <li>(value,index,count) = [selected items]</li>
1485  * <li>(5,0,1) = [{5=15}]</li>
1486  * <li>(5,1,2) = [{9=10}]</li>
1487  * <li>(5,-1,1) = [{4=2}]</li>
1488  * <li>(3,2,1) = [{9=10}]</li>
1489  * <li>(3,-2,2) = [{0=17}]</li>
1490  * </ul>
1491  *
1492  * @ingroup map_operations
1493  */
1494 static inline bool
1496  as_operations* ops, const char* name, as_val* key, int64_t index, uint64_t count,
1497  as_map_return_type return_type
1498  )
1499 {
1500  return as_operations_map_get_by_key_rel_index_range(ops, name, NULL, key, index, count,
1501  return_type);
1502 }
1503 
1504 /**
1505  * Create map get by value operation.
1506  * Server selects map items identified by value and returns selected data specified by return_type.
1507  *
1508  * @ingroup map_operations
1509  */
1510 static inline bool
1512  as_operations* ops, const char* name, as_val* value, as_map_return_type return_type
1513  )
1514 {
1515  return as_operations_map_get_by_value(ops, name, NULL, value, return_type);
1516 }
1517 
1518 /**
1519  * Create map get by value range operation.
1520  * Server selects map items identified by value range (begin inclusive, end exclusive).
1521  * If begin is null, the range is less than end.
1522  * If end is null, the range is greater than equal to begin.
1523  *
1524  * Server returns selected data specified by return_type.
1525  *
1526  * @ingroup map_operations
1527  */
1528 static inline bool
1530  as_operations* ops, const char* name, as_val* begin, as_val* end,
1531  as_map_return_type return_type
1532  )
1533 {
1534  return as_operations_map_get_by_value_range(ops, name, NULL, begin, end, return_type);
1535 }
1536 
1537 /**
1538  * Create map get by value list operation.
1539  * Server selects map items identified by values and returns selected data specified by return_type.
1540  *
1541  * @ingroup map_operations
1542  */
1543 static inline bool
1545  as_operations* ops, const char* name, as_list* values, as_map_return_type return_type
1546  )
1547 {
1548  return as_operations_map_get_by_value_list(ops, name, NULL, values, return_type);
1549 }
1550 
1551 /**
1552  * Create map get by value relative to rank range operation.
1553  * Server selects map items nearest to value and greater by relative rank.
1554  * Server returns selected data specified by return_type.
1555  *
1556  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
1557  * <ul>
1558  * <li>(value,rank) = [selected items]</li>
1559  * <li>(11,1) = [{0=17}]</li>
1560  * <li>(11,-1) = [{9=10},{5=15},{0=17}]</li>
1561  * </ul>
1562  *
1563  * @ingroup map_operations
1564  */
1565 static inline bool
1567  as_operations* ops, const char* name, as_val* value, int64_t rank,
1568  as_map_return_type return_type
1569  )
1570 {
1571  return as_operations_map_get_by_value_rel_rank_range_to_end(ops, name, NULL, value, rank,
1572  return_type);
1573 }
1574 
1575 /**
1576  * Create map get by value relative to rank range operation.
1577  * Server selects map items nearest to value and greater by relative rank with a count limit.
1578  * Server returns selected data specified by return_type.
1579  *
1580  * Examples for map [{4=2},{9=10},{5=15},{0=17}]:
1581  * <ul>
1582  * <li>(value,rank,count) = [selected items]</li>
1583  * <li>(11,1,1) = [{0=17}]</li>
1584  * <li>(11,-1,1) = [{9=10}]</li>
1585  * </ul>
1586  *
1587  * @ingroup map_operations
1588  */
1589 static inline bool
1591  as_operations* ops, const char* name, as_val* value, int64_t rank, uint64_t count,
1592  as_map_return_type return_type
1593  )
1594 {
1595  return as_operations_map_get_by_value_rel_rank_range(ops, name, NULL, value, rank, count,
1596  return_type);
1597 }
1598 
1599 /**
1600  * Create map get by index operation.
1601  * Server selects map item identified by index and returns selected data specified by return_type.
1602  *
1603  * @ingroup map_operations
1604  */
1605 static inline bool
1607  as_operations* ops, const char* name, int64_t index, as_map_return_type return_type
1608  )
1609 {
1610  return as_operations_map_get_by_index(ops, name, NULL, index, return_type);
1611 }
1612 
1613 /**
1614  * Create map get by index range operation.
1615  * Server selects map items starting at specified index to the end of map and returns selected
1616  * data specified by return_type.
1617  *
1618  * @ingroup map_operations
1619  */
1620 static inline bool
1622  as_operations* ops, const char* name, int64_t index, as_map_return_type return_type
1623  )
1624 {
1625  return as_operations_map_get_by_index_range_to_end(ops, name, NULL, index, return_type);
1626 }
1627 
1628 /**
1629  * Create map get by index range operation.
1630  * Server selects `count` map items starting at specified index and returns selected data specified
1631  * by return_type.
1632  *
1633  * @ingroup map_operations
1634  */
1635 static inline bool
1637  as_operations* ops, const char* name, int64_t index, uint64_t count,
1638  as_map_return_type return_type
1639  )
1640 {
1641  return as_operations_map_get_by_index_range(ops, name, NULL, index, count, return_type);
1642 }
1643 
1644 /**
1645  * Create map get by rank operation.
1646  * Server selects map item identified by rank and returns selected data specified by return_type.
1647  *
1648  * @ingroup map_operations
1649  */
1650 static inline bool
1652  as_operations* ops, const char* name, int64_t rank, as_map_return_type return_type
1653  )
1654 {
1655  return as_operations_map_get_by_rank(ops, name, NULL, rank, return_type);
1656 }
1657 
1658 /**
1659  * Create map get by rank range operation.
1660  * Server selects map items starting at specified rank to the last ranked item and returns selected
1661  * data specified by return_type.
1662  *
1663  * @ingroup map_operations
1664  */
1665 static inline bool
1667  as_operations* ops, const char* name, int64_t rank, as_map_return_type return_type
1668  )
1669 {
1670  return as_operations_map_get_by_rank_range_to_end(ops, name, NULL, rank, return_type);
1671 }
1672 
1673 /**
1674  * Create map get by rank range operation.
1675  * Server selects `count` map items starting at specified rank and returns selected data specified
1676  * by return_type.
1677  *
1678  * @ingroup map_operations
1679  */
1680 static inline bool
1682  as_operations* ops, const char* name, int64_t rank, uint64_t count,
1683  as_map_return_type return_type
1684  )
1685 {
1686  return as_operations_map_get_by_rank_range(ops, name, NULL, rank, count, return_type);
1687 }
1688 
1689 #ifdef __cplusplus
1690 } // end extern "C"
1691 #endif
AS_EXTERN bool as_operations_map_get_by_rank_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_rank_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, uint64_t count, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_index(as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_size(as_operations *ops, const char *name)
AS_EXTERN bool as_operations_map_remove_by_rank_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_value_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_create(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_order order)
AS_EXTERN bool as_operations_map_clear(as_operations *ops, const char *name, as_cdt_ctx *ctx)
AS_EXTERN bool as_operations_map_get_by_key_rel_index_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_value_rel_rank_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_key_list(as_operations *ops, const char *name, as_list *keys, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_value_list(as_operations *ops, const char *name, as_list *values, as_map_return_type return_type)
Definition: as_map.h:61
static bool as_operations_add_map_remove_by_value_rel_rank_range_to_end(as_operations *ops, const char *name, as_val *value, int64_t rank, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_index_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_set_policy(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy)
AS_EXTERN bool as_operations_map_remove_by_index_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_put_items(as_operations *ops, const char *name, as_map_policy *policy, as_map *items)
as_map_write_flags
static bool as_operations_add_map_get_by_key_list(as_operations *ops, const char *name, as_list *keys, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_index_range(as_operations *ops, const char *name, int64_t index, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_key_list(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *keys, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_value_rel_rank_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_rank(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
static bool as_operations_add_map_increment(as_operations *ops, const char *name, as_map_policy *policy, as_val *key, as_val *value)
static bool as_operations_add_map_remove_by_key_rel_index_range_to_end(as_operations *ops, const char *name, as_val *key, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_rank(as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
Definition: as_val.h:61
static bool as_operations_add_map_remove_by_value(as_operations *ops, const char *name, as_val *value, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_index(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_set_policy(as_operations *ops, const char *name, as_map_policy *policy)
as_map_order
Definition: as_cdt_order.h:51
#define AS_EXTERN
Definition: as_std.h:25
static bool as_operations_add_map_remove_by_value_range(as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_value_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN void as_map_policy_set_all(as_map_policy *policy, as_map_order order, uint32_t flags, bool persist_index)
AS_EXTERN bool as_operations_map_get_by_value_rel_rank_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
static bool as_operations_add_map_get_by_value_rel_rank_range(as_operations *ops, const char *name, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
static bool as_operations_add_map_get_by_index_range_to_end(as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_decrement(as_operations *ops, const char *name, as_map_policy *policy, as_val *key, as_val *value)
static bool as_operations_add_map_remove_by_index_range_to_end(as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_key_rel_index_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_value_rel_rank_range(as_operations *ops, const char *name, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_put_items(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_map *items)
static bool as_operations_add_map_get_by_index_range(as_operations *ops, const char *name, int64_t index, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_put(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)
static bool as_operations_add_map_get_by_rank_range_to_end(as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
static bool as_operations_add_map_get_by_value_list(as_operations *ops, const char *name, as_list *values, as_map_return_type return_type)
static bool as_operations_add_map_get_by_value_rel_rank_range_to_end(as_operations *ops, const char *name, as_val *value, int64_t rank, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_value(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_key_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_key_list(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *keys, as_map_return_type return_type)
static bool as_operations_add_map_get_by_value_range(as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_increment(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)
AS_EXTERN bool as_operations_map_remove_by_value_rel_rank_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_index(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_size(as_operations *ops, const char *name, as_cdt_ctx *ctx)
static bool as_operations_add_map_remove_by_key(as_operations *ops, const char *name, as_val *key, as_map_return_type return_type)
as_map_return_type
AS_EXTERN bool as_operations_map_remove_by_key_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_key_rel_index_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
as_cdt_op_map
static bool as_operations_add_map_remove_by_rank_range(as_operations *ops, const char *name, int64_t rank, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_value_list(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *values, as_map_return_type return_type)
static bool as_operations_add_map_get_by_key(as_operations *ops, const char *name, as_val *key, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_create_all(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_order order, bool persist_index)
static bool as_operations_add_map_get_by_rank(as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_key(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, as_map_return_type return_type)
static bool as_operations_add_map_clear(as_operations *ops, const char *name)
static bool as_operations_add_map_get_by_key_rel_index_range(as_operations *ops, const char *name, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_key(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_key_rel_index_range(as_operations *ops, const char *name, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_value(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, as_map_return_type return_type)
AS_EXTERN void as_map_policy_set_flags(as_map_policy *policy, as_map_order order, uint32_t flags)
AS_EXTERN bool as_operations_map_get_by_index_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_put(as_operations *ops, const char *name, as_map_policy *policy, as_val *key, as_val *value)
AS_EXTERN bool as_operations_map_remove_by_value_list(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *values, as_map_return_type return_type)
static bool as_operations_add_map_get_by_index(as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_decrement(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)
AS_EXTERN void as_map_policy_init(as_map_policy *policy)
static bool as_operations_add_map_get_by_key_rel_index_range_to_end(as_operations *ops, const char *name, as_val *key, int64_t index, as_map_return_type return_type)
static bool as_operations_add_map_remove_by_rank_range_to_end(as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
static bool as_operations_add_map_get_by_rank_range(as_operations *ops, const char *name, int64_t rank, uint64_t count, as_map_return_type return_type)
as_map_write_mode
AS_EXTERN void as_map_policy_set(as_map_policy *policy, as_map_order order, as_map_write_mode mode)
static bool as_operations_add_map_remove_by_key_range(as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_index_range(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, uint64_t count, as_map_return_type return_type)
static bool as_operations_add_map_get_by_value(as_operations *ops, const char *name, as_val *value, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_rank(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_get_by_rank_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
static bool as_operations_add_map_get_by_key_range(as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
AS_EXTERN bool as_operations_map_remove_by_key_rel_index_range_to_end(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, as_map_return_type return_type)