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