19 |
20 |
Class: DynamoDB
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | DynamoDB
31 |
32 |
33 | DynamoDB
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | new DynamoDB(dynamoDB) → {DynamoDB}
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Create an instance of the DynamoDB Document client.
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | Parameters:
62 |
63 |
64 |
65 |
66 |
67 |
68 | Name |
69 |
70 |
71 | Type |
72 |
73 |
74 |
75 |
76 |
77 | Description |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | dynamoDB |
87 |
88 |
89 |
90 |
91 |
92 | AWS.DynamoDB
93 |
94 |
95 |
96 | |
97 |
98 |
99 |
100 |
101 |
102 | An instance of the service provided AWS SDK (optional). |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | - Source:
132 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | Returns:
157 |
158 |
159 |
160 | Modified version of the service for Document support.
161 |
162 |
163 |
164 |
165 |
166 | -
167 | Type
168 |
169 | -
170 |
171 | DynamoDB
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 | Methods
201 |
202 |
203 |
204 | -
205 |
BinToStr(value) → {string}
206 |
207 |
208 |
209 | -
210 |
211 |
212 |
213 | Utility to convert a Binary object into its String equivalent.
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 | Parameters:
223 |
224 |
225 |
226 |
227 |
228 |
229 | Name |
230 |
231 |
232 | Type |
233 |
234 |
235 |
236 |
237 |
238 | Description |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 | value |
248 |
249 |
250 |
251 |
252 |
253 | object
254 |
255 |
256 |
257 | |
258 |
259 |
260 |
261 |
262 |
263 | Binary value (Buffer | Uint8Array) depending on environment. |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 | - Source:
293 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 | Throws:
316 |
317 |
318 |
319 |
320 |
321 | BinConversionError
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 | Returns:
330 |
331 |
332 |
333 | Return value will be the string representation of the Binary object.
334 |
335 |
336 |
337 |
338 |
339 | -
340 | Type
341 |
342 | -
343 |
344 | string
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 | -
358 |
Condition(key, operator, val1, val2) → {Condition}
359 |
360 |
361 |
362 | -
363 |
364 |
365 |
366 | Creates an instance of Condition and should be used with the DynamoDB client.
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 | Parameters:
376 |
377 |
378 |
379 |
380 |
381 |
382 | Name |
383 |
384 |
385 | Type |
386 |
387 |
388 |
389 |
390 |
391 | Description |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 | key |
401 |
402 |
403 |
404 |
405 |
406 | string
407 |
408 |
409 |
410 | |
411 |
412 |
413 |
414 |
415 |
416 | The attribute name being conditioned. |
417 |
418 |
419 |
420 |
421 |
422 |
423 | operator |
424 |
425 |
426 |
427 |
428 |
429 | string
430 |
431 |
432 |
433 | |
434 |
435 |
436 |
437 |
438 |
439 | The operator in the conditional clause. (See lower level docs for full list of operators) |
440 |
441 |
442 |
443 |
444 |
445 |
446 | val1 |
447 |
448 |
449 |
450 |
451 | |
452 |
453 |
454 |
455 |
456 |
457 | Potential first element in what would be the AttributeValueList |
458 |
459 |
460 |
461 |
462 |
463 |
464 | val2 |
465 |
466 |
467 |
468 |
469 | |
470 |
471 |
472 |
473 |
474 |
475 | Potential second element in what would be the AttributeValueList |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 | - Source:
505 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 | Returns:
530 |
531 |
532 |
533 | Condition for your DynamoDB request.
534 |
535 |
536 |
537 |
538 |
539 | -
540 | Type
541 |
542 | -
543 |
544 | Condition
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 | -
558 |
Set(set, type) → {Set}
559 |
560 |
561 |
562 | -
563 |
564 |
565 |
566 | Utility to create Set Object for requests.
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 | Parameters:
576 |
577 |
578 |
579 |
580 |
581 |
582 | Name |
583 |
584 |
585 | Type |
586 |
587 |
588 |
589 |
590 |
591 | Description |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 | set |
601 |
602 |
603 |
604 |
605 |
606 | array
607 |
608 |
609 |
610 | |
611 |
612 |
613 |
614 |
615 |
616 | An array that contains elements of the same typed as defined by {type}. |
617 |
618 |
619 |
620 |
621 |
622 |
623 | type |
624 |
625 |
626 |
627 |
628 |
629 | string
630 |
631 |
632 |
633 | |
634 |
635 |
636 |
637 |
638 |
639 | Can only be a [S]tring, [N]umber, or [B]inary type. |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 | - Source:
669 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 | Throws:
692 |
693 |
694 |
695 |
696 |
697 | InvalidSetType, InconsistentType
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 | Returns:
706 |
707 |
708 |
709 | Custom Set object that follow {type}.
710 |
711 |
712 |
713 |
714 |
715 | -
716 | Type
717 |
718 | -
719 |
720 | Set
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 | -
734 |
StrToBin(value) → {object}
735 |
736 |
737 |
738 | -
739 |
740 |
741 |
742 | Utility to convert a String to the necessary Binary object.
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 | Parameters:
752 |
753 |
754 |
755 |
756 |
757 |
758 | Name |
759 |
760 |
761 | Type |
762 |
763 |
764 |
765 |
766 |
767 | Description |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 | value |
777 |
778 |
779 |
780 |
781 |
782 | string
783 |
784 |
785 |
786 | |
787 |
788 |
789 |
790 |
791 |
792 | String value to converted to Binary object. |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 | - Source:
822 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 | Throws:
845 |
846 |
847 |
848 |
849 |
850 | StrConversionError
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 | Returns:
859 |
860 |
861 |
862 | Return value will be a Buffer or Uint8Array in the browser.
863 |
864 |
865 |
866 |
867 |
868 | -
869 | Type
870 |
871 | -
872 |
873 | object
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
19 |
20 |
Class: DynamoDBDatatype
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | new DynamoDBDatatype()
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | - Source:
80 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | Methods
127 |
128 |
129 |
130 | -
131 |
binToStr(value) → {string}
132 |
133 |
134 |
135 | -
136 |
137 |
138 |
139 | Utility to convert a Binary object into a decoded String.
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | Parameters:
149 |
150 |
151 |
152 |
153 |
154 |
155 | Name |
156 |
157 |
158 | Type |
159 |
160 |
161 |
162 |
163 |
164 | Description |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | value |
174 |
175 |
176 |
177 |
178 |
179 | object
180 |
181 |
182 |
183 | |
184 |
185 |
186 |
187 |
188 |
189 | Binary value (Buffer | Uint8Array) depending on Node or browser. |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 | - Source:
219 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 | Throws:
242 |
243 |
244 |
245 |
246 |
247 | BinConversionError
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 | Returns:
256 |
257 |
258 |
259 | decoded String in UTF-8
260 |
261 |
262 |
263 |
264 |
265 | -
266 | Type
267 |
268 | -
269 |
270 | string
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 | -
284 |
createSet(set, type) → {Set}
285 |
286 |
287 |
288 | -
289 |
290 |
291 |
292 | Utility to create the DynamoDB Set Datatype.
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 | Parameters:
302 |
303 |
304 |
305 |
306 |
307 |
308 | Name |
309 |
310 |
311 | Type |
312 |
313 |
314 |
315 |
316 |
317 | Description |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 | set |
327 |
328 |
329 |
330 |
331 |
332 | array
333 |
334 |
335 |
336 | |
337 |
338 |
339 |
340 |
341 |
342 | An array that contains elements of the same typed as defined by {type}. |
343 |
344 |
345 |
346 |
347 |
348 |
349 | type |
350 |
351 |
352 |
353 |
354 |
355 | string
356 |
357 |
358 |
359 | |
360 |
361 |
362 |
363 |
364 |
365 | Can only be a [S]tring, [N]umber, or [B]inary type. |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 | - Source:
395 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 | Throws:
418 |
419 |
420 |
421 |
422 |
423 | InvalidSetType, InconsistentType
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 | Returns:
432 |
433 |
434 |
435 | Custom Set object that follow {type}.
436 |
437 |
438 |
439 |
440 |
441 | -
442 | Type
443 |
444 | -
445 |
446 | Set
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 | -
460 |
461 |
462 |
463 |
464 | -
465 |
466 |
467 |
468 | Formats Javascript datatypes into DynamoDB wire format.
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 | Parameters:
478 |
479 |
480 |
481 |
482 |
483 |
484 | Name |
485 |
486 |
487 | Type |
488 |
489 |
490 |
491 |
492 |
493 | Description |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 | dataType |
503 |
504 |
505 |
506 |
507 | |
508 |
509 |
510 |
511 |
512 |
513 | Javascript datatype (i.e. string, number. For full information, check out the README). |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 | - Source:
543 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 | Throws:
566 |
567 |
568 |
569 |
570 |
571 | GeneralDatatypeError
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 | Returns:
580 |
581 |
582 |
583 | DynamoDB JSON-like wire format.
584 |
585 |
586 |
587 |
588 |
589 | -
590 | Type
591 |
592 | -
593 |
594 | object
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 | -
608 |
609 |
610 |
611 |
612 | -
613 |
614 |
615 |
616 | Formats DynamoDB wire format into javascript datatypes.
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 | Parameters:
626 |
627 |
628 |
629 |
630 |
631 |
632 | Name |
633 |
634 |
635 | Type |
636 |
637 |
638 |
639 |
640 |
641 | Description |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 | key |
651 |
652 |
653 |
654 |
655 |
656 | string
657 |
658 |
659 |
660 | |
661 |
662 |
663 |
664 |
665 |
666 | Key that represents the type of the attribute value |
667 |
668 |
669 |
670 |
671 |
672 |
673 | value |
674 |
675 |
676 |
677 |
678 | |
679 |
680 |
681 |
682 |
683 |
684 | Javascript datatype of the attribute value produced by DynamoDB |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 | - Source:
714 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 | Throws:
737 |
738 |
739 |
740 |
741 |
742 | GeneralDatatypeError
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 | -
757 |
strToBin(value) → {object}
758 |
759 |
760 |
761 | -
762 |
763 |
764 |
765 | Utility to convert a String to a Binary object.
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 | Parameters:
775 |
776 |
777 |
778 |
779 |
780 |
781 | Name |
782 |
783 |
784 | Type |
785 |
786 |
787 |
788 |
789 |
790 | Description |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 | value |
800 |
801 |
802 |
803 |
804 |
805 | string
806 |
807 |
808 |
809 | |
810 |
811 |
812 |
813 |
814 |
815 | String value to converted to Binary object. |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 | - Source:
845 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 | Throws:
868 |
869 |
870 |
871 |
872 |
873 | StrConversionError
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 | Returns:
882 |
883 |
884 |
885 | (Buffer | Uint8Array) depending on Node or browser.
886 |
887 |
888 |
889 |
890 |
891 | -
892 | Type
893 |
894 | -
895 |
896 | object
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
19 |
20 |
Class: DynamoDBFormatter
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | DynamoDBFormatter
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | Create an instance of the DynamoDBFormatter.
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | - Source:
82 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | Returns:
107 |
108 |
109 |
110 | A Formatter object that provides methods for formatting DynamoDB requests and responses.
111 |
112 |
113 |
114 |
115 |
116 | -
117 | Type
118 |
119 | -
120 |
121 | DynamoDBFormatter
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | Methods
151 |
152 |
153 |
154 | -
155 |
156 |
157 |
158 |
159 | -
160 |
161 |
162 |
163 | DynamoDBFormatter specifically for unwrapping DynamoDB request objects.
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 | - Source:
195 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 | Returns:
220 |
221 |
222 |
223 | Returns aws sdk version of the request.
224 |
225 |
226 |
227 |
228 |
229 | -
230 | Type
231 |
232 | -
233 |
234 | object
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 | -
248 |
249 |
250 |
251 |
252 | -
253 |
254 |
255 |
256 | DynamoDBFormatter specifically for wrapping DynamoDB response objects.
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 | - Source:
288 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 | Returns:
313 |
314 |
315 |
316 | Wrapped up response object.
317 |
318 |
319 |
320 |
321 |
322 | -
323 | Type
324 |
325 | -
326 |
327 | object
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
19 |
20 |
Source: condition.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | "use strict";
29 |
30 | /**
31 | * Creates an instance of Condition that is used by the DynamoDB Document client.
32 | *
33 | * @param {string} key The attribute name being conditioned on.
34 | * @param {string} operator The operator in the conditional clause. (See aws sdk docs for full list of operators)
35 | * @param val1 Potential first element in what would be the AttributeValueList
36 | * @param val2 Potential second element in what would be the AttributeValueList
37 | * @return {Condition} Condition for your DynamoDB request.
38 | */
39 | function DynamoDBCondition(key, operator, val1, val2) {
40 | var datatypes = typeof(window) === "undefined" ? require("./datatypes").DynamoDBDatatype
41 | : window.DynamoDBDatatype;
42 |
43 | var t = new datatypes();
44 |
45 | var CondObj = function Condition(key, operator, val1, val2) {
46 | this.key = key;
47 | this.operator = operator;
48 | this.val1 = val1;
49 | this.val2 = val2;
50 |
51 | this.format = function() {
52 | var formatted = {};
53 |
54 | var attrValueList = [];
55 | if (this.val1 !== undefined) {
56 | attrValueList.push(t.formatDataType(this.val1));
57 | }
58 | if (this.val2 !== undefined) {
59 | attrValueList.push(t.formatDataType(this.val2));
60 | }
61 | if (attrValueList.length > 0) {
62 | formatted.AttributeValueList = attrValueList;
63 | }
64 | formatted.ComparisonOperator = this.operator;
65 |
66 | return formatted;
67 | };
68 | };
69 |
70 | var cond = new CondObj(key, operator, val1, val2);
71 | cond.prototype = Object.create(Object.prototype);
72 | cond.prototype.instanceOf = "DynamoDBConditionObject";
73 |
74 | return cond;
75 | }
76 |
77 | if (typeof(module) !== "undefined") {
78 | var exports = module.exports = {};
79 | exports.DynamoDBCondition = DynamoDBCondition;
80 | }
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
19 |
20 |
Source: datatypes.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | "use strict";
29 |
30 | /**
31 | * @class Creates a DynamoDBDatatype that takes care of all datatype handling.
32 | *
33 | * @name DynamoDBDatatype
34 | */
35 | function DynamoDBDatatype() {
36 | var AWS = typeof(window) === "undefined" ? require("aws-sdk") : window.AWS;
37 | var Uint8ArrayError = "Uint8Array can only be used for Binary in Browser.";
38 | var ScalarDatatypeError = "Unrecognized Scalar Datatype to be formatted.";
39 | var GeneralDatatypeError = "Unrecognized Datatype to be formatted.";
40 | var BinConversionError = "Need to pass in Buffer or Uint8Array. ";
41 | var StrConversionError = "Need to pass in string primitive to be converted to binary.";
42 |
43 | function isScalarType(dataType) {
44 |
45 | var type = typeof(dataType);
46 | return type === "number" ||
47 | type === "string" ||
48 | type === "boolean" ||
49 | (dataType instanceof(Uint8Array) && AWS.util.isBrowser()) ||
50 | dataType instanceof(AWS.util.Buffer) ||
51 | dataType === null;
52 | }
53 |
54 | function isSetType(dataType) {
55 | return dataType.datatype === "SS" ||
56 | dataType.datatype === "NS" ||
57 | dataType.datatype === "BS";
58 | }
59 |
60 | function isRecursiveType(dataType) {
61 |
62 | return Array.isArray(dataType) ||
63 | typeof(dataType) === "object";
64 | }
65 |
66 | function formatRecursiveType(dataType) {
67 |
68 | var recursiveDoc = {};
69 |
70 | var value = {};
71 | var type = "M";
72 | if (Array.isArray(dataType)) {
73 | value = [];
74 | type = "L";
75 | }
76 |
77 | for (var key in dataType) {
78 | value[key] = this.formatDataType(dataType[key]);
79 | }
80 |
81 | recursiveDoc[type] = value;
82 | return recursiveDoc;
83 | }
84 |
85 | /** @throws Uint8ArrayError, ScalarDatatypeError
86 | * @private */
87 | function formatScalarType(dataType) {
88 |
89 | if (dataType == null) {
90 | return { "NULL" : true };
91 | }
92 |
93 | var type = typeof(dataType);
94 | if (type === "string") {
95 | return { "S" : dataType };
96 | } else if (type === "number") {
97 | return { "N" : String(dataType) };
98 | } else if (type === "boolean") {
99 | return { "BOOL" : dataType };
100 | } else if (dataType instanceof(AWS.util.Buffer)) {
101 | return { "B" : dataType };
102 | } else if (dataType instanceof(Uint8Array)) {
103 | if (AWS.util.isBrowser()) {
104 | return { "B" : dataType };
105 | } else {
106 | throw new Error(Uint8ArrayError);
107 | }
108 | } else {
109 | throw new Error(ScalarDatatypeError);
110 | }
111 | }
112 |
113 | /**
114 | * Formats Javascript datatypes into DynamoDB wire format.
115 | *
116 | * @name formatDataType
117 | * @function
118 | * @memberOf DynamoDBDatatype#
119 | * @param dataType Javascript datatype (i.e. string, number. For full information, check out the README).
120 | * @return {object} DynamoDB JSON-like wire format.
121 | * @throws GeneralDatatypeError
122 | */
123 | this.formatDataType = function(dataType) {
124 |
125 | if (isScalarType(dataType)) {
126 | return formatScalarType(dataType);
127 | } else if (isSetType(dataType)) {
128 | return dataType.format();
129 | } else if (isRecursiveType(dataType)) {
130 | return formatRecursiveType.call(this, dataType);
131 | } else {
132 | throw new Error(GeneralDatatypeError);
133 | }
134 |
135 | };
136 |
137 | function str2Bin(value) {
138 | if (typeof(value) !== "string") {
139 | throw new Error(StrConversionError);
140 | }
141 |
142 | if (AWS.util.isBrowser()) {
143 | var len = value.length;
144 | var bin = new Uint8Array(new ArrayBuffer(len));
145 | for (var i = 0; i < len; i++) {
146 | bin[i] = value.charCodeAt(i);
147 | }
148 | return bin;
149 | } else {
150 | return AWS.util.Buffer(value);
151 | }
152 | }
153 |
154 | /**
155 | * Utility to convert a String to a Binary object.
156 | *
157 | * @function strToBin
158 | * @memberOf DynamoDBDatatype#
159 | * @param {string} value String value to converted to Binary object.
160 | * @return {object} (Buffer | Uint8Array) depending on Node or browser.
161 | * @throws StrConversionError
162 | */
163 | this.strToBin = function(value) {
164 | return str2Bin.call(this, value);
165 | };
166 |
167 | function bin2Str(value) {
168 | if (!(value instanceof(AWS.util.Buffer)) && !(value instanceof(Uint8Array))) {
169 | throw new Error(BinConversionError);
170 | }
171 |
172 | if (AWS.util.isBrowser()) {
173 | return String.fromCharCode.apply(null, value);
174 | } else {
175 | return value.toString("utf-8").valueOf();
176 | }
177 | }
178 |
179 | /**
180 | * Utility to convert a Binary object into a decoded String.
181 | *
182 | * @function binToStr
183 | * @memberOf DynamoDBDatatype#
184 | * @param {object} value Binary value (Buffer | Uint8Array) depending on Node or browser.
185 | * @return {string} decoded String in UTF-8
186 | * @throws BinConversionError
187 | */
188 | this.binToStr = function(value) {
189 | return bin2Str.call(this, value);
190 | };
191 |
192 | /**
193 | * Utility to create the DynamoDB Set Datatype.
194 | *
195 | * @function createSet
196 | * @memberOf DynamoDBDatatype#
197 | * @param {array} set An array that contains elements of the same typed as defined by {type}.
198 | * @param {string} type Can only be a [S]tring, [N]umber, or [B]inary type.
199 | * @return {Set} Custom Set object that follow {type}.
200 | * @throws InvalidSetType, InconsistentType
201 | */
202 | this.createSet = function(set, type) {
203 | if (type !== "N" && type !== "S" && type !== "B") {
204 | throw new Error(this.type + " is an invalid type for Set");
205 | }
206 |
207 | var setObj = function Set(set, type) {
208 | this.datatype = type + "S";
209 | this.contents = {};
210 |
211 | this.add = function(value) {
212 | if (this.datatype === "SS" && typeof(value) === "string") {
213 | this.contents[value] = value;
214 | } else if (this.datatype === "NS" && typeof(value) === "number") {
215 | this.contents[value] = value;
216 | } else if (this.datatype === "BS" && value instanceof(AWS.util.Buffer)) {
217 | this.contents[bin2Str(value)] = value;
218 | } else if (this.datatype === "BS" && value instanceof(Uint8Array)) {
219 | if (AWS.util.isBrowser()) {
220 | this.contents[bin2Str(value)] = value;
221 | } else {
222 | throw new Error(Uint8ArrayError);
223 | }
224 | } else {
225 | throw new Error("Inconsistent in this " + this.type + " Set");
226 | }
227 | };
228 |
229 | this.contains = function(content) {
230 | var value = content;
231 | if (content instanceof AWS.util.Buffer || content instanceof(Uint8Array)) {
232 | value = bin2Str(content);
233 | }
234 | if (this.contents[value] === undefined) {
235 | return false;
236 | }
237 | return true;
238 | };
239 |
240 | this.remove = function(content) {
241 | var value = content;
242 | if (content instanceof AWS.util.Buffer || content instanceof(Uint8Array)) {
243 | value = bin2Str(content);
244 | }
245 | delete this.contents[value];
246 | };
247 |
248 | this.toArray = function() {
249 | var keys = Object.keys(this.contents);
250 | var arr = [];
251 |
252 | for (var keyIndex in keys) {
253 | var key = keys[keyIndex];
254 | if (this.contents.hasOwnProperty(key)) {
255 | arr.push(this.contents[key]);
256 | }
257 | }
258 |
259 | return arr;
260 | };
261 |
262 | this.format = function() {
263 | var values = this.toArray();
264 | var result = {};
265 | result[this.datatype] = values;
266 | return result;
267 | };
268 |
269 | if (set) {
270 | for (var index in set) {
271 | this.add(set[index]);
272 | }
273 | }
274 | };
275 |
276 | return new setObj(set, type);
277 | };
278 |
279 | /**
280 | * Formats DynamoDB wire format into javascript datatypes.
281 | *
282 | * @name formatWireType
283 | * @function
284 | * @memberOf DynamoDBDatatype#
285 | * @param {string} key Key that represents the type of the attribute value
286 | * @param value Javascript datatype of the attribute value produced by DynamoDB
287 | * @throws GeneralDatatypeError
288 | */
289 | this.formatWireType = function(key, value) {
290 | switch (key) {
291 | case "S":
292 | case "B":
293 | case "BOOL":
294 | return value;
295 | case "N":
296 | return Number(value);
297 | case "NULL":
298 | return null;
299 | case "L":
300 | case "M":
301 | for (var keyIndex in value) {
302 | var subValue = value[keyIndex];
303 | var subKey = Object.keys(subValue)[0];
304 | value[keyIndex] = this.formatWireType(subKey, subValue[subKey]);
305 | }
306 | return value;
307 | case "SS":
308 | return new this.createSet(value, "S");
309 | case "NS":
310 | value = value.map(function(each) { return Number(each);});
311 | return new this.createSet(value, "N");
312 | case "BS":
313 | return new this.createSet(value, "B");
314 | default:
315 | throw "Service returned unrecognized datatype " + key;
316 | }
317 | }
318 | }
319 |
320 | if (typeof(module) !== "undefined") {
321 | var exports = module.exports = {};
322 | exports.DynamoDBDatatype = DynamoDBDatatype;
323 | }
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
19 |
20 |
Source: dynamodb-doc.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | "use strict";
29 |
30 | /**
31 | * Create an instance of the DynamoDB Document client.
32 | *
33 | * @constructor
34 | * @class DynamoDB
35 | * @param {AWS.DynamoDB} dynamoDB An instance of the service provided AWS SDK (optional).
36 | * @returns {DynamoDB} Modified version of the service for Document support.
37 | */
38 | function DynamoDB(dynamoDB) {
39 | var isBrowser = typeof(window) === "undefined";
40 | var AWS = isBrowser ? require("aws-sdk") : window.AWS;
41 |
42 | var condition = isBrowser ? require("./condition").DynamoDBCondition : window.DynamoDBCondition;
43 |
44 | var datatypes = isBrowser ? require("./datatypes").DynamoDBDatatype : window.DynamoDBDatatype;
45 | var t = new datatypes();
46 |
47 | var formatter = isBrowser ? require("./formatter").DynamoDBFormatter : window.DynamoDBFormatter;
48 | var f = new formatter();
49 |
50 | var service = dynamoDB || new AWS.DynamoDB();
51 |
52 | if (!(service instanceof(AWS.DynamoDB))) {
53 | throw new Error("Need an instance of AWS.DynamoDB as an argument.");
54 | }
55 |
56 | var setupLowLevelRequestListeners = service.setupRequestListeners;
57 | service.setupRequestListeners = function(request) {
58 | setupLowLevelRequestListeners.call(this, request);
59 |
60 | request._events.validate.unshift(f.formatInput);
61 | request.on("extractData", f.formatOutput);
62 | };
63 |
64 | /**
65 | * Utility to create Set Object for requests.
66 | *
67 | * @function Set
68 | * @memberOf DynamoDB#
69 | * @param {array} set An array that contains elements of the same typed as defined by {type}.
70 | * @param {string} type Can only be a [S]tring, [N]umber, or [B]inary type.
71 | * @return {Set} Custom Set object that follow {type}.
72 | * @throws InvalidSetType, InconsistentType
73 | */
74 | service.__proto__.Set = function(set, type) {
75 | return t.createSet(set, type);
76 | };
77 |
78 | /**
79 | * Creates an instance of Condition and should be used with the DynamoDB client.
80 | *
81 | * @function Condition
82 | * @memberOf DynamoDB#
83 | * @param {string} key The attribute name being conditioned.
84 | * @param {string} operator The operator in the conditional clause. (See lower level docs for full list of operators)
85 | * @param val1 Potential first element in what would be the AttributeValueList
86 | * @param val2 Potential second element in what would be the AttributeValueList
87 | * @return {Condition} Condition for your DynamoDB request.
88 | */
89 | service.__proto__.Condition = function(key, operator, val1, val2) {
90 | return condition(key, operator, val1, val2);
91 | };
92 |
93 | /**
94 | * Utility to convert a String to the necessary Binary object.
95 | *
96 | * @function StrToBin
97 | * @memberOf DynamoDB#
98 | * @param {string} value String value to converted to Binary object.
99 | * @return {object} Return value will be a Buffer or Uint8Array in the browser.
100 | * @throws StrConversionError
101 | */
102 | service.__proto__.StrToBin = function(value) {
103 | return t.strToBin(value);
104 | };
105 | /**
106 | * Utility to convert a Binary object into its String equivalent.
107 | *
108 | * @function BinToStr
109 | * @memberOf DynamoDB#
110 | * @param {object} value Binary value (Buffer | Uint8Array) depending on environment.
111 | * @return {string} Return value will be the string representation of the Binary object.
112 | * @throws BinConversionError
113 | */
114 | service.__proto__.BinToStr = function(value) {
115 | return t.binToStr(value);
116 | };
117 |
118 | return service;
119 | }
120 |
121 | if (typeof(module) !== "undefined") {
122 | var exports = module.exports = {};
123 | exports.DynamoDB = DynamoDB;
124 | }
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
19 |
20 |
Source: formatter.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | "use strict";
29 |
30 | /**
31 | * Create an instance of the DynamoDBFormatter.
32 | * @constructor
33 | * @return {DynamoDBFormatter} A Formatter object that provides methods for formatting DynamoDB requests and responses.
34 | */
35 | function DynamoDBFormatter() {
36 | var datatypes = typeof(window) === "undefined" ? require("./datatypes").DynamoDBDatatype : window.DynamoDBDatatype;
37 | var t = new datatypes();
38 | var EmptyConditionArray = "Need to pass in an array with 1 or more Condition Objects.";
39 | var BadElementInConditionArray = "Only Condition objects are allowed as members of the array.";
40 | var InvalidCondition = "Need to pass in a valid Condition Object.";
41 |
42 | function formatAttrValInput(attrValueMap) {
43 | var attributeValueMap = {};
44 | for (var attr in attrValueMap) {
45 | var value = attrValueMap[attr];
46 | attributeValueMap[attr] = t.formatDataType(value);
47 | }
48 | return attributeValueMap;
49 | }
50 |
51 | function formatConditions(conditions) {
52 | if (conditions.prototype && conditions.prototype.instanceOf === "DynamoDBConditionObject") {
53 | conditions = [conditions];
54 | } else {
55 | if (Array.isArray(conditions)) {
56 | if (conditions.length === 0) {
57 | throw new Error(EmptyConditionArray);
58 | }
59 | for (var index in conditions) {
60 | var condition = conditions[index];
61 | if (!(condition.prototype) || !(condition.prototype.instanceOf === "DynamoDBConditionObject")) {
62 | throw new Error(BadElementInConditionArray);
63 | }
64 | }
65 | } else {
66 | throw new Error(InvalidCondition);
67 | }
68 | }
69 |
70 | var expected = {};
71 | for (var index in conditions) {
72 | var condition = conditions[index];
73 | expected[condition.key] = condition.format();
74 | }
75 | return expected;
76 | }
77 |
78 | function formatUpdates(updates) {
79 | var attrUpdates = {};
80 | for (var attr in updates) {
81 | if (updates.hasOwnProperty(attr)) {
82 | var actionValue = {};
83 | var value = updates[attr].Value;
84 | var action = updates[attr].Action;
85 |
86 | actionValue.Action = action;
87 | actionValue.Value = t.formatDataType(value);
88 |
89 | attrUpdates[attr] = actionValue;
90 | }
91 | }
92 |
93 | return attrUpdates;
94 | }
95 |
96 | function handleWriteRequest(request) {
97 | var requestCopy = {};
98 |
99 | if (request.DeleteRequest) {
100 | var key = request.DeleteRequest.Key;
101 | requestCopy.DeleteRequest = {};
102 | requestCopy.DeleteRequest.Key = formatAttrValInput(key);
103 | } else {
104 | var item = request.PutRequest.Item;
105 | requestCopy.PutRequest = {};
106 | requestCopy.PutRequest.Item = formatAttrValInput(item);
107 | }
108 |
109 | return requestCopy;
110 | }
111 |
112 | function formatRequestItems(requests) {
113 | var requestItems = {};
114 |
115 | for (var table in requests) {
116 | if (requests.hasOwnProperty(table)) {
117 | requestItems[table] = {};
118 |
119 | var request = requests[table];
120 | if (Array.isArray(request)) {
121 | var writeRequests = [];
122 | for (var wIndex in request) {
123 | writeRequests.push(handleWriteRequest(request[wIndex]));
124 | }
125 | requestItems[table] = writeRequests;
126 | } else {
127 | if (request.AttributesToGet) {
128 | requestItems[table].AttributesToGet = request.AttributesToGet;
129 | }
130 | if (request.ConsistentRead) {
131 | requestItems[table].ConsistentRead = request.ConsistentRead;
132 | }
133 | if (request.Keys) {
134 | var keys = [];
135 | for (var gIndex in request.Keys) {
136 | var key = request.Keys[gIndex];
137 | keys.push(formatAttrValInput(key));
138 | }
139 | requestItems[table].Keys = keys;
140 | }
141 | }
142 | }
143 | }
144 |
145 | return requestItems;
146 | }
147 |
148 | var inputMap = { "AttributeUpdates": formatUpdates,
149 | "ExclusiveStartKey": formatAttrValInput,
150 | "Expected": formatConditions,
151 | "ExpressionAttributeValues": formatAttrValInput,
152 | "Item": formatAttrValInput,
153 | "Key": formatAttrValInput,
154 | "KeyConditions": formatConditions,
155 | "RequestItems": formatRequestItems,
156 | "ScanFilter": formatConditions,
157 | "QueryFilter": formatConditions};
158 |
159 |
160 | function formatAttrValOutput(item) {
161 | var attrList = {};
162 | for (var attribute in item) {
163 | var keys = Object.keys(item[attribute]);
164 | var key = keys[0];
165 | var value = item[attribute][key];
166 |
167 | value = t.formatWireType(key, value);
168 | attrList[attribute] = value;
169 | }
170 |
171 | return attrList;
172 | }
173 |
174 | function formatItems(items) {
175 | for (var index in items) {
176 | items[index] = formatAttrValOutput(items[index]);
177 | }
178 | return items;
179 | }
180 |
181 | function handleCollectionKey(metrics) {
182 | var collectionKey = metrics.ItemCollectionKey;
183 | metrics.ItemCollectionKey = formatAttrValOutput(collectionKey);
184 | return metrics;
185 | }
186 |
187 | function handleBatchMetrics(metrics) {
188 | for (var table in metrics) {
189 | if (metrics.hasOwnProperty(table)) {
190 | var listOfKeys = metrics[table];
191 | for (var index in listOfKeys) {
192 | listOfKeys[index] = handleCollectionKey(listOfKeys[index]);
193 | }
194 | }
195 | }
196 | return metrics;
197 | }
198 |
199 | function formatMetrics(metrics) {
200 | var collectionKey = metrics.ItemCollectionKey;
201 | if (collectionKey) {
202 | metrics = handleCollectionKey(metrics);
203 | } else {
204 | metrics = handleBatchMetrics(metrics);
205 | }
206 | return metrics;
207 | }
208 |
209 | function formatResponses(responses) {
210 | for (var table in responses) {
211 | if (responses.hasOwnProperty(table)) {
212 | var listOfItems = responses[table];
213 | for (var index in listOfItems) {
214 | listOfItems[index] = formatAttrValOutput(listOfItems[index]);
215 | }
216 | }
217 | }
218 |
219 | return responses;
220 | }
221 |
222 | function formatUnprocessedItems(unprocessedItems) {
223 | for(var table in unprocessedItems) {
224 | if (unprocessedItems.hasOwnProperty(table)) {
225 | var tableInfo = unprocessedItems[table];
226 | for (var index in tableInfo) {
227 | var request = tableInfo[index];
228 | if (request.DeleteRequest) {
229 | tableInfo[index].DeleteRequest.Key = formatAttrValOutput(request.DeleteRequest.Key);
230 | } else {
231 | tableInfo[index].PutRequest.Item = formatAttrValOutput(request.PutRequest.Item);
232 | }
233 | }
234 | }
235 | }
236 | return unprocessedItems;
237 | }
238 |
239 | function formatUnprocessedKeys(unprocessedKeys) {
240 | for (var table in unprocessedKeys) {
241 | if (unprocessedKeys.hasOwnProperty(table)) {
242 | var tableInfo = unprocessedKeys[table];
243 | var listOfKeys = tableInfo.Keys;
244 | for (var index in listOfKeys) {
245 | tableInfo.Keys[index] = formatAttrValOutput(listOfKeys[index]);
246 | }
247 | }
248 | }
249 |
250 | return unprocessedKeys;
251 | }
252 |
253 | /**
254 | * DynamoDBFormatter specifically for wrapping DynamoDB response objects.
255 | *
256 | * @function formatOutput
257 | * @memberOf DynamoDBFormatter#
258 | * @params {object} response Response object directly passed out by the service.
259 | * @returns {object} Wrapped up response object.
260 | */
261 | this.formatOutput = function(response) {
262 | var outputMap = {"Attributes": formatAttrValOutput,
263 | "Item": formatAttrValOutput,
264 | "Items": formatItems,
265 | "ItemCollectionMetrics": formatMetrics,
266 | "LastEvaluatedKey": formatAttrValOutput,
267 | "Responses": formatResponses,
268 | "UnprocessedKeys": formatUnprocessedKeys,
269 | "UnprocessedItems": formatUnprocessedItems};
270 |
271 |
272 | var data = response.data;
273 | if (data) {
274 | for (var key in data) {
275 | if (data.hasOwnProperty(key)) {
276 | var formatFunc = outputMap[key];
277 | if (formatFunc) {
278 | response.data[key] = formatFunc(data[key]);
279 | }
280 | }
281 | }
282 | }
283 | };
284 |
285 | /**
286 | * DynamoDBFormatter specifically for unwrapping DynamoDB request objects.
287 | *
288 | * @function formatInput
289 | * @memberOf DynamoDBFormatter#
290 | * @params {object} request Request object created by the service.
291 | * @return {object} Returns aws sdk version of the request.
292 | */
293 | this.formatInput = function (request) {
294 | var paramsCopy = {};
295 | var params = request.params;
296 |
297 | for (var key in params) {
298 | if (params.hasOwnProperty(key)) {
299 | var param = params[key];
300 | var formatFunc = inputMap[key];
301 | if (formatFunc) {
302 | param = formatFunc(param);
303 | }
304 | paramsCopy[key] = param;
305 | }
306 | }
307 |
308 | request.params = paramsCopy;
309 | };
310 | }
311 |
312 | if (typeof(module) !== "undefined") {
313 | var exports = module.exports = {};
314 | exports.DynamoDBFormatter = DynamoDBFormatter;
315 | }
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
19 |
20 |
Global
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | Methods
92 |
93 |
94 |
95 | -
96 |
DynamoDBCondition(key, operator, val1, val2) → {Condition}
97 |
98 |
99 |
100 | -
101 |
102 |
103 |
104 | Creates an instance of Condition that is used by the DynamoDB Document client.
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 | Parameters:
114 |
115 |
116 |
117 |
118 |
119 |
120 | Name |
121 |
122 |
123 | Type |
124 |
125 |
126 |
127 |
128 |
129 | Description |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | key |
139 |
140 |
141 |
142 |
143 |
144 | string
145 |
146 |
147 |
148 | |
149 |
150 |
151 |
152 |
153 |
154 | The attribute name being conditioned on. |
155 |
156 |
157 |
158 |
159 |
160 |
161 | operator |
162 |
163 |
164 |
165 |
166 |
167 | string
168 |
169 |
170 |
171 | |
172 |
173 |
174 |
175 |
176 |
177 | The operator in the conditional clause. (See aws sdk docs for full list of operators) |
178 |
179 |
180 |
181 |
182 |
183 |
184 | val1 |
185 |
186 |
187 |
188 |
189 | |
190 |
191 |
192 |
193 |
194 |
195 | Potential first element in what would be the AttributeValueList |
196 |
197 |
198 |
199 |
200 |
201 |
202 | val2 |
203 |
204 |
205 |
206 |
207 | |
208 |
209 |
210 |
211 |
212 |
213 | Potential second element in what would be the AttributeValueList |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 | - Source:
243 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 | Returns:
268 |
269 |
270 |
271 | Condition for your DynamoDB request.
272 |
273 |
274 |
275 |
276 |
277 | -
278 | Type
279 |
280 | -
281 |
282 | Condition
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |