1 | <!DOCTYPE html>
|
2 | <html lang="en">
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <title>JSDoc: Class: LokiFsStructuredAdapter</title>
|
6 |
|
7 | <script src="scripts/prettify/prettify.js"> </script>
|
8 | <script src="scripts/prettify/lang-css.js"> </script>
|
9 | |
10 |
|
11 |
|
12 | <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
13 | <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
14 | </head>
|
15 |
|
16 | <body>
|
17 |
|
18 | <div id="main">
|
19 |
|
20 | <h1 class="page-title">Class: LokiFsStructuredAdapter</h1>
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | <section>
|
28 |
|
29 | <header>
|
30 |
|
31 | <h2>LokiFsStructuredAdapter</h2>
|
32 |
|
33 |
|
34 | </header>
|
35 |
|
36 | <article>
|
37 | <div class="container-overview">
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | <h4 class="name" id="LokiFsStructuredAdapter"><span class="type-signature"></span>new LokiFsStructuredAdapter<span class="signature">()</span><span class="type-signature"></span></h4>
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | <div class="description">
|
50 | <p>Loki structured (node) filesystem adapter class.
|
51 | This class fulfills the loki 'reference' abstract adapter interface which can be applied to other storage methods.</p>
|
52 | </div>
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | <dl class="details">
|
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 |
|
92 |
|
93 | <dt class="tag-source">Source:</dt>
|
94 | <dd class="tag-source"><ul class="dummy"><li>
|
95 | <a href="loki-fs-structured-adapter.js.html">loki-fs-structured-adapter.js</a>, <a href="loki-fs-structured-adapter.js.html#line33">line 33</a>
|
96 | </li></ul></dd>
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | </dl>
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | </div>
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 | <h3 class="subsection-title">Methods</h3>
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | <h4 class="name" id="exportDatabase"><span class="type-signature"></span>exportDatabase<span class="signature">(dbname, dbref, callback)</span><span class="type-signature"></span></h4>
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 | <div class="description">
|
151 | <p>Loki reference adapter interface function. Saves structured json via loki database object reference.</p>
|
152 | </div>
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | <h5>Parameters:</h5>
|
163 |
|
164 |
|
165 | <table class="params">
|
166 | <thead>
|
167 | <tr>
|
168 |
|
169 | <th>Name</th>
|
170 |
|
171 |
|
172 | <th>Type</th>
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 | <th class="last">Description</th>
|
179 | </tr>
|
180 | </thead>
|
181 |
|
182 | <tbody>
|
183 |
|
184 |
|
185 | <tr>
|
186 |
|
187 | <td class="name"><code>dbname</code></td>
|
188 |
|
189 |
|
190 | <td class="type">
|
191 |
|
192 |
|
193 | <span class="param-type">string</span>
|
194 |
|
195 |
|
196 |
|
197 | </td>
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | <td class="description last"><p>the name to give the serialized database within the catalog.</p></td>
|
204 | </tr>
|
205 |
|
206 |
|
207 |
|
208 | <tr>
|
209 |
|
210 | <td class="name"><code>dbref</code></td>
|
211 |
|
212 |
|
213 | <td class="type">
|
214 |
|
215 |
|
216 | <span class="param-type">object</span>
|
217 |
|
218 |
|
219 |
|
220 | </td>
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 | <td class="description last"><p>the loki database object reference to save.</p></td>
|
227 | </tr>
|
228 |
|
229 |
|
230 |
|
231 | <tr>
|
232 |
|
233 | <td class="name"><code>callback</code></td>
|
234 |
|
235 |
|
236 | <td class="type">
|
237 |
|
238 |
|
239 | <span class="param-type">function</span>
|
240 |
|
241 |
|
242 |
|
243 | </td>
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 | <td class="description last"><p>callback passed obj.success with true or false</p></td>
|
250 | </tr>
|
251 |
|
252 |
|
253 | </tbody>
|
254 | </table>
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 | <dl class="details">
|
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 |
|
288 | <dt class="tag-source">Source:</dt>
|
289 | <dd class="tag-source"><ul class="dummy"><li>
|
290 | <a href="loki-fs-structured-adapter.js.html">loki-fs-structured-adapter.js</a>, <a href="loki-fs-structured-adapter.js.html#line198">line 198</a>
|
291 | </li></ul></dd>
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 | </dl>
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 | <h4 class="name" id="generateDestructured"><span class="type-signature"></span>generateDestructured<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {string|array}</span></h4>
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 | <div class="description">
|
328 | <p>Generator for constructing lines for file streaming output of db container or collection.</p>
|
329 | </div>
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 | <h5>Parameters:</h5>
|
340 |
|
341 |
|
342 | <table class="params">
|
343 | <thead>
|
344 | <tr>
|
345 |
|
346 | <th>Name</th>
|
347 |
|
348 |
|
349 | <th>Type</th>
|
350 |
|
351 |
|
352 | <th>Attributes</th>
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | <th class="last">Description</th>
|
358 | </tr>
|
359 | </thead>
|
360 |
|
361 | <tbody>
|
362 |
|
363 |
|
364 | <tr>
|
365 |
|
366 | <td class="name"><code>options</code></td>
|
367 |
|
368 |
|
369 | <td class="type">
|
370 |
|
371 |
|
372 | <span class="param-type">object</span>
|
373 |
|
374 |
|
375 |
|
376 | </td>
|
377 |
|
378 |
|
379 | <td class="attributes">
|
380 |
|
381 | <optional><br>
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 | </td>
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | <td class="description last"><p>output format options for use externally to loki</p>
|
393 | <h6>Properties</h6>
|
394 |
|
395 |
|
396 | <table class="params">
|
397 | <thead>
|
398 | <tr>
|
399 |
|
400 | <th>Name</th>
|
401 |
|
402 |
|
403 | <th>Type</th>
|
404 |
|
405 |
|
406 | <th>Attributes</th>
|
407 |
|
408 |
|
409 |
|
410 |
|
411 | <th class="last">Description</th>
|
412 | </tr>
|
413 | </thead>
|
414 |
|
415 | <tbody>
|
416 |
|
417 |
|
418 | <tr>
|
419 |
|
420 | <td class="name"><code>partition</code></td>
|
421 |
|
422 |
|
423 | <td class="type">
|
424 |
|
425 |
|
426 | <span class="param-type">int</span>
|
427 |
|
428 |
|
429 |
|
430 | </td>
|
431 |
|
432 |
|
433 | <td class="attributes">
|
434 |
|
435 | <optional><br>
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 | </td>
|
442 |
|
443 |
|
444 |
|
445 |
|
446 | <td class="description last"><p>can be used to only output an individual collection or db (-1)</p></td>
|
447 | </tr>
|
448 |
|
449 |
|
450 | </tbody>
|
451 | </table>
|
452 |
|
453 | </td>
|
454 | </tr>
|
455 |
|
456 |
|
457 | </tbody>
|
458 | </table>
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 | <dl class="details">
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 | <dt class="tag-source">Source:</dt>
|
493 | <dd class="tag-source"><ul class="dummy"><li>
|
494 | <a href="loki-fs-structured-adapter.js.html">loki-fs-structured-adapter.js</a>, <a href="loki-fs-structured-adapter.js.html#line56">line 56</a>
|
495 | </li></ul></dd>
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 | </dl>
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 | <h5>Returns:</h5>
|
518 |
|
519 |
|
520 | <div class="param-desc">
|
521 | <p>A custom, restructured aggregation of independent serializations.</p>
|
522 | </div>
|
523 |
|
524 |
|
525 |
|
526 | <dl>
|
527 | <dt>
|
528 | Type
|
529 | </dt>
|
530 | <dd>
|
531 |
|
532 | <span class="param-type">string</span>
|
533 | |
|
534 |
|
535 | <span class="param-type">array</span>
|
536 |
|
537 |
|
538 | </dd>
|
539 | </dl>
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | <h4 class="name" id="getPartition"><span class="type-signature"></span>getPartition<span class="signature">()</span><span class="type-signature"></span></h4>
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 | <div class="description">
|
557 | <p>Generator for yielding sequence of dirty partition indices to iterate.</p>
|
558 | </div>
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 | <dl class="details">
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 | <dt class="tag-source">Source:</dt>
|
600 | <dd class="tag-source"><ul class="dummy"><li>
|
601 | <a href="loki-fs-structured-adapter.js.html">loki-fs-structured-adapter.js</a>, <a href="loki-fs-structured-adapter.js.html#line175">line 175</a>
|
602 | </li></ul></dd>
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 | </dl>
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 | <h4 class="name" id="loadDatabase"><span class="type-signature"></span>loadDatabase<span class="signature">(dbname, callback)</span><span class="type-signature"></span></h4>
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 | <div class="description">
|
639 | <p>Loki persistence adapter interface function which outputs un-prototype db object reference to load from.</p>
|
640 | </div>
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 | <h5>Parameters:</h5>
|
651 |
|
652 |
|
653 | <table class="params">
|
654 | <thead>
|
655 | <tr>
|
656 |
|
657 | <th>Name</th>
|
658 |
|
659 |
|
660 | <th>Type</th>
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 | <th class="last">Description</th>
|
667 | </tr>
|
668 | </thead>
|
669 |
|
670 | <tbody>
|
671 |
|
672 |
|
673 | <tr>
|
674 |
|
675 | <td class="name"><code>dbname</code></td>
|
676 |
|
677 |
|
678 | <td class="type">
|
679 |
|
680 |
|
681 | <span class="param-type">string</span>
|
682 |
|
683 |
|
684 |
|
685 | </td>
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 | <td class="description last"><p>the name of the database to retrieve.</p></td>
|
692 | </tr>
|
693 |
|
694 |
|
695 |
|
696 | <tr>
|
697 |
|
698 | <td class="name"><code>callback</code></td>
|
699 |
|
700 |
|
701 | <td class="type">
|
702 |
|
703 |
|
704 | <span class="param-type">function</span>
|
705 |
|
706 |
|
707 |
|
708 | </td>
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 | <td class="description last"><p>callback should accept string param containing db object reference.</p></td>
|
715 | </tr>
|
716 |
|
717 |
|
718 | </tbody>
|
719 | </table>
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 | <dl class="details">
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 | <dt class="tag-source">Source:</dt>
|
754 | <dd class="tag-source"><ul class="dummy"><li>
|
755 | <a href="loki-fs-structured-adapter.js.html">loki-fs-structured-adapter.js</a>, <a href="loki-fs-structured-adapter.js.html#line103">line 103</a>
|
756 | </li></ul></dd>
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 | </dl>
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 | <h4 class="name" id="loadNextCollection"><span class="type-signature"></span>loadNextCollection<span class="signature">(dbname, collectionIndex, callback)</span><span class="type-signature"></span></h4>
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 | <div class="description">
|
793 | <p>Recursive function to chain loading of each collection one at a time.
|
794 | If at some point i can determine how to make async driven generator, this may be converted to generator.</p>
|
795 | </div>
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 | <h5>Parameters:</h5>
|
806 |
|
807 |
|
808 | <table class="params">
|
809 | <thead>
|
810 | <tr>
|
811 |
|
812 | <th>Name</th>
|
813 |
|
814 |
|
815 | <th>Type</th>
|
816 |
|
817 |
|
818 |
|
819 |
|
820 |
|
821 | <th class="last">Description</th>
|
822 | </tr>
|
823 | </thead>
|
824 |
|
825 | <tbody>
|
826 |
|
827 |
|
828 | <tr>
|
829 |
|
830 | <td class="name"><code>dbname</code></td>
|
831 |
|
832 |
|
833 | <td class="type">
|
834 |
|
835 |
|
836 | <span class="param-type">string</span>
|
837 |
|
838 |
|
839 |
|
840 | </td>
|
841 |
|
842 |
|
843 |
|
844 |
|
845 |
|
846 | <td class="description last"><p>the name to give the serialized database within the catalog.</p></td>
|
847 | </tr>
|
848 |
|
849 |
|
850 |
|
851 | <tr>
|
852 |
|
853 | <td class="name"><code>collectionIndex</code></td>
|
854 |
|
855 |
|
856 | <td class="type">
|
857 |
|
858 |
|
859 | <span class="param-type">int</span>
|
860 |
|
861 |
|
862 |
|
863 | </td>
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 | <td class="description last"><p>the ordinal position of the collection to load.</p></td>
|
870 | </tr>
|
871 |
|
872 |
|
873 |
|
874 | <tr>
|
875 |
|
876 | <td class="name"><code>callback</code></td>
|
877 |
|
878 |
|
879 | <td class="type">
|
880 |
|
881 |
|
882 | <span class="param-type">function</span>
|
883 |
|
884 |
|
885 |
|
886 | </td>
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 | <td class="description last"><p>callback to pass to next invocation or to call when done</p></td>
|
893 | </tr>
|
894 |
|
895 |
|
896 | </tbody>
|
897 | </table>
|
898 |
|
899 |
|
900 |
|
901 |
|
902 |
|
903 |
|
904 | <dl class="details">
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 | <dt class="tag-source">Source:</dt>
|
932 | <dd class="tag-source"><ul class="dummy"><li>
|
933 | <a href="loki-fs-structured-adapter.js.html">loki-fs-structured-adapter.js</a>, <a href="loki-fs-structured-adapter.js.html#line139">line 139</a>
|
934 | </li></ul></dd>
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 | </dl>
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | </article>
|
966 |
|
967 | </section>
|
968 |
|
969 |
|
970 |
|
971 |
|
972 | </div>
|
973 |
|
974 | <nav>
|
975 | <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Collection.html">Collection</a></li><li><a href="DynamicView.html">DynamicView</a></li><li><a href="Loki.html">Loki</a></li><li><a href="LokiEventEmitter.html">LokiEventEmitter</a></li><li><a href="LokiFsAdapter.html">LokiFsAdapter</a></li><li><a href="LokiFsStructuredAdapter.html">LokiFsStructuredAdapter</a></li><li><a href="LokiIndexedAdapter.html">LokiIndexedAdapter</a></li><li><a href="LokiLocalStorageAdapter.html">LokiLocalStorageAdapter</a></li><li><a href="LokiMemoryAdapter.html">LokiMemoryAdapter</a></li><li><a href="LokiPartitioningAdapter.html">LokiPartitioningAdapter</a></li><li><a href="Resultset.html">Resultset</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-Autoupdating Collections.html">Autoupdating Collections</a></li><li><a href="tutorial-Changes API.html">Changes API</a></li><li><a href="tutorial-Collection Transforms.html">Collection Transforms</a></li><li><a href="tutorial-Indexing and Query performance.html">Indexing and Query performance</a></li><li><a href="tutorial-Loki Angular.html">Loki Angular</a></li><li><a href="tutorial-Persistence Adapters.html">Persistence Adapters</a></li><li><a href="tutorial-Query Examples.html">Query Examples</a></li></ul>
|
976 | </nav>
|
977 |
|
978 | <br class="clear">
|
979 |
|
980 | <footer>
|
981 | Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Sun Dec 18 2016 19:39:52 GMT-0500 (Eastern Standard Time)
|
982 | </footer>
|
983 |
|
984 | <script> prettyPrint(); </script>
|
985 | <script src="scripts/linenumber.js"> </script>
|
986 | </body>
|
987 | </html> |
\ | No newline at end of file |