en-US/Mdbc.dll-Help.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
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
354
355
356
357
358
359
360
361
362
363
364
365
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
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
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
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
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
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
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
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
714
715
716
717
718
719
720
721
722
723
724
725
726
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
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
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
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
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
900
901
902
903
904
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
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns="http://msh" schema="maml">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Connect-Mdbc</command:name>
<maml:description>
<maml:para>Connects a server, database, and collection.</maml:para>
</maml:description>
<command:verb>Connect</command:verb>
<command:noun>Mdbc</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet connects the specified server, database, and collection and creates their reference variables in the current scope. With default names they are Server, Database, and Collection.
 
The * used as a name tells to get all database names for a server or collection names for a database.
 
If none of the parameters ConnectionString, DatabaseName, CollectionName is specified then they are assumed to be ., test, test respectively.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Connect-Mdbc</maml:name>
<command:parameter required="false" position="1" >
<maml:name>ConnectionString</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>DatabaseName</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="3" >
<maml:name>CollectionName</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>CollectionVariable</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>DatabaseVariable</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>ServerVariable</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Timeout</maml:name>
<command:parameterValue required="true">TimeSpan</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewCollection</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>Connection string (see driver manuals for details):
mongodb://[username:password@]hostname[:port][/[database][?options]]
 
&quot;.&quot; is used for the default driver connection.
 
Examples:
    mongodb://localhost:27017
    mongodb://myaccount:mypass@remotehost.example.com/mydatabase</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>DatabaseName</maml:name>
<maml:description>
<maml:para>Database name. * is used in order to get all database objects.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="3" >
<maml:name>CollectionName</maml:name>
<maml:description>
<maml:para>Collection name. * is used in order to get all collection objects.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>CollectionVariable</maml:name>
<maml:description>
<maml:para>Name of a new variable in the current scope with the connected collection. The default variable name is Collection. The default variable is used implicitly by cmdlets operating on collection data.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>DatabaseVariable</maml:name>
<maml:description>
<maml:para>Name of a new variable in the current scope with the connected database. The default variable name is Database.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewCollection</maml:name>
<maml:description>
<maml:para>Tells to remove an existing collection if any and connect a new one.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>ServerVariable</maml:name>
<maml:description>
<maml:para>Name of a new variable in the current scope with the connected server. The default variable name is Server.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Timeout</maml:name>
<maml:description>
<maml:para>Determines the maximum time to wait before timing out.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>None or database or collection names.</maml:name>
</dev:type>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># Connect to a new collection (drop existing)
Import-Module Mdbc
Connect-Mdbc . test test -NewCollection</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code># Connect to the database
Import-Module Mdbc
Connect-Mdbc . test
 
# Then get collections
$collection1 = $Database.GetCollection(&apos;test&apos;)
$collection2 = $Database.GetCollection(&apos;process&apos;)</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
<dev:code># Connect to the server
Import-Module Mdbc
Connect-Mdbc mongodb://localhost
 
# Then get the database
$Database = $Server.GetDatabase(&apos;test&apos;)</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title>
<dev:code># Connect to the default server and get all databases
Import-Module Mdbc
Connect-Mdbc . *</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title>
<dev:code># Connect to the database &apos;test&apos; and get all collections
Import-Module Mdbc
Connect-Mdbc . test *</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Add-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Get-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Remove-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Update-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>MongoDB</maml:linkText>
<maml:uri>http://www.mongodb.org</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>New-MdbcData</command:name>
<maml:description>
<maml:para>Creates data documents and some other driver types.</maml:para>
</maml:description>
<command:verb>New</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>This command is used to create one or more documents (input objects come from the pipeline or as the first parameter InputObject) or a single BsonValue (by the named parameter Value).
 
Created documents are used by Add-MdbcData and Export-MdbcData. These cmdlets also have parameters Id, NewId, Convert, Property for making documents from input objects. Thus, in some cases intermediate use of New-MdbcData is not needed.
 
Mdbc.Dictionary
 
Result documents are returned as Mdbc.Dictionary objects. Mdbc.Dictionary holds an underlying BsonDocument (Document()) and implements IDictionary. It works as a hashtable where keys are case sensitive strings and input and output values are convenient .NET types instead of underlying BsonValues. Main features:
 
Useful members:
 
    $dictionary.Count
    $dictionary.Contains(&apos;key&apos;)
    $dictionary.Add(&apos;key&apos;, &apos;value&apos;)
    $dictionary.Remove(&apos;key&apos;)
    $dictionary.Clear()
 
Setting values:
 
    $dictionary[&apos;key&apos;] = ...
    $dictionary.key = ...
 
Getting values:
 
    .. = $dictionary[&apos;key&apos;]
    .. = $dictionary.key
 
NOTE: On getting values the form &quot;$dictionary.key&quot; fails in strict mode (see Set-StrictMode) if the &quot;key&quot; is missing. The form &quot;$dictionary[&apos;key&apos;] is safe, it returns null for a missing key. Use Contains() in order to check existence of a key for sure.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>New-MdbcData</maml:name>
<command:parameter required="false" position="named" >
<maml:name>Value</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>InputObject</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Convert</maml:name>
<command:parameterValue required="true">ScriptBlock</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Id</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewId</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" pipelineInput="true (ByValue)" position="1" >
<maml:name>InputObject</maml:name>
<maml:description>
<maml:para>.NET object to be converted to Mdbc.Dictionary, PowerShell friendly wrapper of BsonDocument. Objects suitable for conversion are dictionaries, custom objects, and complex .NET types, normally not collections.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Convert</maml:name>
<maml:description>
<maml:para>A script called on exceptions during conversion of unknown data to BsonValue. The variable $_ is the problem object to be converted. The script returns a single value to be tried instead or nothing for nulls.
 
Examples: {} converts unknown data to nulls. {&quot;$_&quot;} converts data to strings, it is useful for preserving as much information as possible on dumping objects for later analysis.
 
Converters should be used sparingly, normally with unknown or varying data. Consider to use Property for selecting standard and converting not standard known data.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Id</maml:name>
<maml:description>
<maml:para>The document _id value to be assigned or a script block returning this value for the input object represented by the variable $_.
 
_id must not exist in input objects or be specified again by Property.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewId</maml:name>
<maml:description>
<maml:para>Tells to generate and assign a new document _id as MongoDB.Bson.ObjectId.
 
_id must not exist in input objects or be specified again by Property.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<maml:description>
<maml:para>Specifies properties or keys which values are to be included into documents or defines calculated fields. Missing input properties and keys are ignored.
 
Arguments are defined in three ways:
 
1. Strings define property or key names and the corresponding result document field names.
 
2. Hashtables @{Key=Value} define renamed and calculated fields. The key is a new document field name. The value is either a string (input object property name) or a script block (field value calculated from the input object $_).
 
3. Hashtables @{Name=...; Expression=...} or @{Label=...; Expression=...} are similar but use the same convention as the parameter Property of Select-Object.
 
See New-MdbcData examples.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Value</maml:name>
<maml:description>
<maml:para>An object to be converted to a BsonValue.
 
Cmdlets and helper types do not need BsonValue&apos;s, they convert everything themselves. But BsonValue&apos;s may be needed for calling driver methods directly.
 
Containers:
 
    [IDictionary] is converted to BsonDocument.
    [IEnumerable] is converted to BsonArray.
 
Primitives:
 
    [bool] is converted to BsonBoolean.
    [DateTime] is converted to BsonDateTime.
    [double] is converted to BsonDouble.
    [Guid] is converted to BsonBinaryData (and retrieved back as [Guid]).
    [int] is converted to BsonInt32.
    [long] is converted to BsonInt64.
    [string] is converted to BsonString.
 
If a primitive type is known than it is much more effective to create it directly than by this cmdlet, e.g. for a string:
 
    [MongoDB.Bson.BsonString]&apos;Some text&apos;</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>$null</maml:name>
</dev:type>
<maml:description>
<maml:para>Null is converted to an empty document by New-MdbcData and ignored by Add-MdbcData and Export-MdbcData.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects created by New-MdbcData or obtained by Get-MdbcData or Import-MdbcData. This type is the most effective and safe as input/output of Mdbc data cmdlets.
 
The native driver document [MongoDB.Bson.BsonDocument] can be used as well but normally it should not be used directly. Its wrapper [Mdbc.Dictionary] is more suitable in PowerShell.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[IDictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Dictionaries are converted to new documents. Keys are strings used as new field names. Collection, dictionary, and custom object values are converted to BSON container types recursively. Other values are converted to BsonValue.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[PSObject]</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects are converted to new documents. Property names are used as new field names. Collection, dictionary, and custom object values are converted to BSON container types recursively. Other values are converted to BsonValue.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>BsonDocument wrapper created from InputObject.</maml:para>
</maml:description>
</command:returnValue>
<command:returnValue>
<dev:type>
<maml:name>[MongoDB.Bson.BsonValue]</maml:name>
</dev:type>
<maml:description>
<maml:para>BsonValue objects created from Value.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># Connect to the collection
Import-Module Mdbc
Connect-Mdbc . test test -NewCollection
 
# Create a new document, set some data
$data = New-MdbcData -Id 12345
$data.Text = &apos;Hello world&apos;
$data.Date = Get-Date
 
# Add the document to the database
$data | Add-MdbcData
 
# Query the document from the database
$result = Get-MdbcData (New-MdbcQuery _id 12345)
$result</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code># Connect to the collection
Import-Module Mdbc
Connect-Mdbc . test test -NewCollection
 
# Create data from input objects and add to the database
Get-Process mongod |
New-MdbcData -Id {$_.Id} -Property Name, WorkingSet, StartTime |
Add-MdbcData
 
# Query the data
$result = Get-MdbcData
$result</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
<dev:code># Example of various forms of property expressions.
# Note that ExitCode throws, so that Code will be null.
 
New-MdbcData (Get-Process -Id $Pid) -Property `
    Name, # existing property name
    Missing, # missing property name is ignored
    @{WS1 = &apos;WS&apos;}, # @{name = old name} - renamed property
    @{WS2 = {$_.WS}}, # @{name = scriptblock} - calculated field
    @{Ignored = &apos;Missing&apos;}, # renaming of a missing property is ignored
    @{n = &apos;_id&apos;; e = &apos;Id&apos;}, # @{name=...; expression=...} like Select-Object does
    @{l = &apos;Code&apos;; e = &apos;ExitCode&apos;} # @{label=...; expression=...} another like Select-Object</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Add-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Export-MdbcData</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>New-MdbcQuery</command:name>
<maml:description>
<maml:para>Creates a query expression for other commands.</maml:para>
</maml:description>
<command:verb>New</command:verb>
<command:noun>MdbcQuery</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet creates a query expression used by Get-MdbcData, Remove-MdbcData, Update-MdbcData. Parameters are named after the driver query builder methods. Most of queries have their alternative JSON-like forms, see parameter help.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="true" position="named" >
<maml:name>And</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="true" position="named" >
<maml:name>Not</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="true" position="named" >
<maml:name>Or</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="true" position="named" >
<maml:name>Where</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>All</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>ElemMatch</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="2" >
<maml:name>EQ</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Exists</maml:name>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>GT</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>GTE</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>IEQ</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>In</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>INE</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>LT</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>LTE</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Matches</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Mod</maml:name>
<command:parameterValue required="true">Int64[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>NE</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>NotExists</maml:name>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>NotIn</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Size</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Type</maml:name>
<command:parameterValue required="true">BsonType</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>New-MdbcQuery</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>TypeAlias</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>Name</maml:name>
<maml:description>
<maml:para>Field name for a field value test.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="2" >
<maml:name>EQ</maml:name>
<maml:description>
<maml:para>Equality test. Parameter name is optional. JSON-like form: @{name = value}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>All</maml:name>
<maml:description>
<maml:para>Checks if the array contains all the specified values. JSON-like form: @{name = @{&apos;$all&apos; = @(value1, value2, ...)}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>And</maml:name>
<maml:description>
<maml:para>Logical And, normally on two or more query expressions. JSON-like form: @{&apos;$and&apos; = @(query-expression1, query-expression2, ...)}</maml:para>
<maml:para>One argument can be used as well. For a previously created query it creates the same query. But it can be used for creating a query from other supported input types like hashtables.</maml:para>
<maml:para>The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>ElemMatch</maml:name>
<maml:description>
<maml:para>Checks if an element in an array matches all the specified query expressions. JSON-like form: @{name = @{&apos;$elemMatch&apos; = @(expression1, expression2, ...)}}</maml:para>
<maml:para>It is needed only when more than one field must be matched in an array element.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Exists</maml:name>
<maml:description>
<maml:para>Checks if the field exists. JSON-like form: @{name = @{&apos;$exists&apos; = $true}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>GT</maml:name>
<maml:description>
<maml:para>Greater than test. JSON-like form: @{name = @{&apos;$gt&apos; = value}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>GTE</maml:name>
<maml:description>
<maml:para>Greater or equal test. JSON-like form: @{name = @{&apos;$gte&apos; = value}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>IEQ</maml:name>
<maml:description>
<maml:para>Ignore case equality test for strings. JSON-like form is not available.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>In</maml:name>
<maml:description>
<maml:para>Checks if the field value equals or matches to one of the specified values or regular expressions. JSON-like form: @{name = @{&apos;$in&apos; = @(value1, value2, ...)}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>INE</maml:name>
<maml:description>
<maml:para>Ignore case inequality test for strings. JSON-like form is not available.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>LT</maml:name>
<maml:description>
<maml:para>Less than test. JSON-like form: @{name = @{&apos;$lt&apos; = value}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>LTE</maml:name>
<maml:description>
<maml:para>Less or equal test. JSON-like form: @{name = @{&apos;$lte&apos; = value}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Matches</maml:name>
<maml:description>
<maml:para>Regular expression test. JSON-like form: @{name = @{&apos;$regex&apos; = pattern; &apos;$options&apos; = &apos;i|m|x|s&apos;}}</maml:para>
<maml:para>The argument is one or two items. A single item is either a regular expression string pattern or a regular expression object. Two items are both strings: a regular expression pattern and options, combination of characters &apos;i&apos;, &apos;m&apos;, &apos;x&apos;, &apos;s&apos;.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Mod</maml:name>
<maml:description>
<maml:para>Modulo test. JSON-like form: @{name = @{&apos;$mod&apos; = @(divisor, remainder)}}</maml:para>
<maml:para>The argument is an array of two items: the modulus and the result value to be tested.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>NE</maml:name>
<maml:description>
<maml:para>Inequality test. JSON-like form: @{name = @{&apos;$ne&apos; = value}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Not</maml:name>
<maml:description>
<maml:para>Tells to negate the query expression. JSON-like form: @{name = @{&apos;$not&apos; = operator-expression}</maml:para>
<maml:para>The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>NotExists</maml:name>
<maml:description>
<maml:para>Checks if the field is missing. JSON-like form: @{name = @{&apos;$exists&apos; = $false}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>NotIn</maml:name>
<maml:description>
<maml:para>Checks if the field is missing or its value does not equal or match to any of the specified values or regular expressions. JSON-like form: @{name = @{&apos;$nin&apos; = @(value1, value2, ...)}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Or</maml:name>
<maml:description>
<maml:para>Logical Or, normally on two or more query expressions. JSON-like form: @{&apos;$or&apos; = @(query-expression1, query-expression2, ...)}</maml:para>
<maml:para>One argument can be used as well. For a previously created query it creates the same query. But it can be used for creating a query from other supported input types like hashtables.</maml:para>
<maml:para>The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Size</maml:name>
<maml:description>
<maml:para>Array item count test. JSON-like form: @{name = @{&apos;$size&apos; = value}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Type</maml:name>
<maml:description>
<maml:para>Element type test. JSON-like form: @{name = @{&apos;$type&apos; = type}}</maml:para>
<maml:para>Values : EndOfDocument, Double, String, Document, Array, Binary, Undefined, ObjectId, Boolean, DateTime, Null, RegularExpression, JavaScript, Symbol, JavaScriptWithScope, Int32, Timestamp, Int64, Decimal128, MaxKey, MinKey</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>TypeAlias</maml:name>
<maml:description>
<maml:para>Element type test with an alias. JSON-like form: @{name = @{&apos;$type&apos; = &apos;type&apos;}}</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Where</maml:name>
<maml:description>
<maml:para>JavaScript Boolean expression test. JSON-like form: @{&apos;$where&apos; = code}</maml:para>
<maml:para>The database evaluates the expression for each object scanned. JavaScript executes more slowly than native operators but is very flexible. See the server-side processing page for more information (official site).</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[MongoDB.Driver.IMongoQuery]</maml:name>
</dev:type>
<maml:description>
<maml:para>Used by Get-MdbcData, Remove-MdbcData, Update-MdbcData, ...</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Get-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Remove-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Update-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>MongoDB</maml:linkText>
<maml:uri>http://www.mongodb.org</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>New-MdbcUpdate</command:name>
<maml:description>
<maml:para>Creates an update expression for Update-MdbcData.</maml:para>
</maml:description>
<command:verb>New</command:verb>
<command:noun>MdbcUpdate</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlet creates update expressions used by Update-MdbcData. Parameters are named after driver update builder methods. They can be combined in order to create complex updates in a single call.
 
Some parameters (Unset, PopFirst, PopLast) require only field names (String[]). Example:
 
    New-MdbcUpdate -Unset field1 -PopLast field2, field3
 
Other parameters require field names and associated arguments. Such parameters accept one or more hashtables (IDictionary). Each hashtable defines field names as keys and arguments as their values. The following commands are essentially the same:
 
    # Two hashtables with single entries
    New-MdbcUpdate -Set @{field1 = value1}, @{field2 = value2}
 
    # One hashtable with two entries
    New-MdbcUpdate -Set @{
        field1 = value1
        field2 = value2
    }</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>New-MdbcUpdate</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Set</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>AddToSet</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>AddToSetEach</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BitwiseAnd</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BitwiseOr</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BitwiseXor</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>CurrentDate</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Inc</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Max</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Min</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Mul</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PopFirst</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PopLast</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Pull</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PullAll</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Push</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PushAll</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Rename</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SetOnInsert</maml:name>
<command:parameterValue required="true">PSObject[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Unset</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>Set</maml:name>
<maml:description>
<maml:para>Sets a field value. This parameter name can be omitted in a command, i.e. these commands are the same:
 
    New-MdbcUpdate @{field = value}
 
    New-MdbcUpdate -Set @{field = value}
 
Mongo: { $set: { field1: &lt;value1&gt;, ... } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>AddToSet</maml:name>
<maml:description>
<maml:para>Adds a value to an array only if the value is not in the array already.
 
If a field argument is a collection then it is treated as a single value to add. Use AddToSetEach in order to add each value.
 
Mongo: { $addToSet: { field: &lt;addition&gt; }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>AddToSetEach</maml:name>
<maml:description>
<maml:para>Adds values to an array only if the values are not in the array already.
 
Mongo: { $addToSet: { field: { $each: [ &lt;value1&gt;, &lt;value2&gt; ... ] } } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BitwiseAnd</maml:name>
<maml:description>
<maml:para>Performs bitwise AND update of integer values (int or long).
 
Mongo: { $bit: { field: { and: NumberInt(5) } } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BitwiseOr</maml:name>
<maml:description>
<maml:para>Performs bitwise OR update of integer values (int or long).
 
Mongo: { $bit: { field: { or: NumberInt(5) } } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BitwiseXor</maml:name>
<maml:description>
<maml:para>Performs bitwise XOR update of integer values (int or long).
 
Mongo: { $bit: { field: { xor: NumberInt(5) } } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>CurrentDate</maml:name>
<maml:description>
<maml:para>The $currentDate operator sets the value of a field to the current date.
 
Mongo: { $currentDate: { field: true } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Inc</maml:name>
<maml:description>
<maml:para>Increments a field by a specified number. If a field does not exist, it adds the field and sets it to the specified value. It accepts positive and negative values (int, long, or double).
 
Mongo: { $inc: { field: &lt;number&gt; } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Max</maml:name>
<maml:description>
<maml:para>The $max operator updates the value of the field to a specified value if the specified value is greater than the current value of the field. If the field does not exists, the $max operator sets the field to the specified value. The $max operator can compare values of different types, using the BSON comparison order.
 
Mongo: { $max: { field: &lt;value&gt; } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Min</maml:name>
<maml:description>
<maml:para>The $min updates the value of the field to a specified value if the specified value is less than the current value of the field. If the field does not exists, the $min operator sets the field to the specified value. The $min operator can compare values of different types, using the BSON comparison order.
 
Mongo: { $min: { field: &lt;value&gt; } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Mul</maml:name>
<maml:description>
<maml:para>Multiplies a field by a specified number. The field to update must contain a numeric value. If the field does not exist, it creates the field and sets the value to zero of the same numeric type as the multiplier.
 
Mongo: { $mul: { field: &lt;number&gt; } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PopFirst</maml:name>
<maml:description>
<maml:para>Removes the first element in an array.
 
It fails if a field is not an array. When it removes the last remaining item a field holds an empty array.
 
Mongo: { $pop: { field: -1 } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PopLast</maml:name>
<maml:description>
<maml:para>Removes the last element in an array.
 
It fails if a field is not an array. When it removes the last remaining item a field holds an empty array.
 
Mongo: { $pop: { field: 1 } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Pull</maml:name>
<maml:description>
<maml:para>Removes matching values from a field if it is an array. It fails if a field is present but it is not an array.
 
If a field argument is a collection then it is treated as a single value to pull. Use PullAll in order to remove each value.
 
If a field argument is a query expression than items matching the expression are removed. The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.
 
Mongo: { $pull: { field: &lt;value&gt;|&lt;query&gt; } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PullAll</maml:name>
<maml:description>
<maml:para>Removes multiple values from an existing array. PullAll provides the inverse operation of PushAll.
 
Mongo: { $pullAll: { field: [ value1, value2, ... ] } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Push</maml:name>
<maml:description>
<maml:para>Appends a value to a field if it is an existing array, otherwise sets a field to an array with one value. It fails if a field is present but it is not an array.
 
If a field argument is a collection then it is treated as a single value to push. Use PushAll in order to push all values.
 
Mongo: { $push: { field: &lt;value&gt; }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>PushAll</maml:name>
<maml:description>
<maml:para>Appends all values to an array.
 
Mongo: { $push: { field: { $each: [ value1, valu2 ... ] } } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Rename</maml:name>
<maml:description>
<maml:para>Renames a field. A field argument is a new field name.
 
Mongo: { $rename: { &lt;old name1&gt;: &lt;new name1&gt; }, ... }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SetOnInsert</maml:name>
<maml:description>
<maml:para>Sets a field value on adding a new document during update. It has no effect on updates that modify existing documents.
 
Mongo: { $setOnInsert: { field1: &lt;value1&gt;, ... } }</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Unset</maml:name>
<maml:description>
<maml:para>Tells to remove a field from an existing document.
 
Mongo: { $unset: { field1: &quot;&quot;, ... } }</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[MongoDB.Driver.IMongoUpdate]</maml:name>
</dev:type>
<maml:description>
<maml:para>Update expression used by Update-MdbcData.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Update-MdbcData</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Add-MdbcData</command:name>
<maml:description>
<maml:para>Adds new documents to the database collection or updates existing.</maml:para>
</maml:description>
<command:verb>Add</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>Adds new documents to the database collection or updates existing.</maml:para>
<maml:para>In order to output command result objects from a server use the switch Result.
 
Depending on operations some server exceptions are caught and written as not terminating errors, i.e. processing of remaining pipelined objects continues.
 
Parameters ErrorAction and variables $ErrorActionPreference are used to alter error actions. See help about_CommonParameters and about_Preference_Variables.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Add-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>InputObject</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Convert</maml:name>
<command:parameterValue required="true">ScriptBlock</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Id</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>WriteConcern</maml:name>
<command:parameterValue required="true">WriteConcern</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewId</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Result</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Update</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" pipelineInput="true (ByValue)" position="1" >
<maml:name>InputObject</maml:name>
<maml:description>
<maml:para>Document or a similar object, see INPUTS.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object. It is obtained by Connect-Mdbc, Open-MdbcFile, or using the driver methods, for example from a database instance. If it is not specified then the variable Collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Convert</maml:name>
<maml:description>
<maml:para>A script called on exceptions during conversion of unknown data to BsonValue. The variable $_ is the problem object to be converted. The script returns a single value to be tried instead or nothing for nulls.
 
Examples: {} converts unknown data to nulls. {&quot;$_&quot;} converts data to strings, it is useful for preserving as much information as possible on dumping objects for later analysis.
 
Converters should be used sparingly, normally with unknown or varying data. Consider to use Property for selecting standard and converting not standard known data.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Id</maml:name>
<maml:description>
<maml:para>The document _id value to be assigned or a script block returning this value for the input object represented by the variable $_.
 
_id must not exist in input objects or be specified again by Property.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewId</maml:name>
<maml:description>
<maml:para>Tells to generate and assign a new document _id as MongoDB.Bson.ObjectId.
 
_id must not exist in input objects or be specified again by Property.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<maml:description>
<maml:para>Specifies properties or keys which values are to be included into documents or defines calculated fields. Missing input properties and keys are ignored.
 
Arguments are defined in three ways:
 
1. Strings define property or key names and the corresponding result document field names.
 
2. Hashtables @{Key=Value} define renamed and calculated fields. The key is a new document field name. The value is either a string (input object property name) or a script block (field value calculated from the input object $_).
 
3. Hashtables @{Name=...; Expression=...} or @{Label=...; Expression=...} are similar but use the same convention as the parameter Property of Select-Object.
 
See New-MdbcData examples.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Result</maml:name>
<maml:description>
<maml:para>Tells to output an object returned by the driver.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Update</maml:name>
<maml:description>
<maml:para>Tells to update existing documents with the same _id or add new documents otherwise.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>WriteConcern</maml:name>
<maml:description>
<maml:para>Write concern options.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>$null</maml:name>
</dev:type>
<maml:description>
<maml:para>Null is converted to an empty document by New-MdbcData and ignored by Add-MdbcData and Export-MdbcData.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects created by New-MdbcData or obtained by Get-MdbcData or Import-MdbcData. This type is the most effective and safe as input/output of Mdbc data cmdlets.
 
The native driver document [MongoDB.Bson.BsonDocument] can be used as well but normally it should not be used directly. Its wrapper [Mdbc.Dictionary] is more suitable in PowerShell.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[IDictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Dictionaries are converted to new documents. Keys are strings used as new field names. Collection, dictionary, and custom object values are converted to BSON container types recursively. Other values are converted to BsonValue.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[PSObject]</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects are converted to new documents. Property names are used as new field names. Collection, dictionary, and custom object values are converted to BSON container types recursively. Other values are converted to BsonValue.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[MongoDB.Driver.WriteConcernResult]</maml:name>
</dev:type>
<maml:description>
<maml:para>Result object from the driver is written if the switch Result is present.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>New-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Select-Object</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Get-MdbcData</command:name>
<maml:description>
<maml:para>Gets documents or information from a database collection.</maml:para>
</maml:description>
<command:verb>Get</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlets invokes queries for the specified or default collection and outputs result documents or other data according to the parameters.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Get-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Distinct</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Get-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Remove</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Modes</maml:name>
<command:parameterValue required="true">QueryFlags</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SortBy</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Get-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Count</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>First</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Last</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Modes</maml:name>
<command:parameterValue required="true">QueryFlags</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Skip</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Get-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>First</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Last</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Modes</maml:name>
<command:parameterValue required="true">QueryFlags</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Skip</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SortBy</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Get-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Update</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Modes</maml:name>
<command:parameterValue required="true">QueryFlags</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>ResultVariable</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SortBy</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Add</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>New</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<maml:description>
<maml:para>Specifies documents to be processed. The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Add</maml:name>
<maml:description>
<maml:para>Tells to add new documents on Update if old documents do not exist.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<maml:description>
<maml:para>Specifies the representation of output documents. The argument is either a required type or a shortcut enum value for special types.
 
A type specifies the output type literally. Type properties must match the document fields or the custom type serialization must be registered.
 
Shortcuts, either enum values or strings:
 
    Default
        Default output, Mdbc.Dictionary with underlying BsonDocument.
 
    Lazy
        Mdbc.LazyDictionary with underlying LazyBsonDocument.
        Call Dispose() after use.
 
    Raw
        Mdbc.RawDictionary with underlying RawBsonDocument.
        Read only. Call Dispose() after use.
 
    PS
        PowerShell custom object.
 
By default result documents are represented by Mdbc.Dictionary with underlying BsonDocument. See New-MdbcData for details. Use of its Lazy or Raw form may improve performance in some cases.
 
In some scenarios other output types may be suitable like native .NET types (-As ([Type])) and PowerShell custom objects (-As PS).
 
On choosing an output type keep in mind that Mdbc.Dictionary (BsonDocument) field names are case sensitive unlike object properties in PowerShell.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object. It is obtained by Connect-Mdbc, Open-MdbcFile, or using the driver methods, for example from a database instance. If it is not specified then the variable Collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Count</maml:name>
<maml:description>
<maml:para>Tells to return the number of all documents or matching the Query. The First and Skip values are taken into account.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Distinct</maml:name>
<maml:description>
<maml:para>Specifies the field name and tells to return its distinct values for all documents or documents matching the Query.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>First</maml:name>
<maml:description>
<maml:para>Specifies the number of first documents to be returned. Non positive values are ignored.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Last</maml:name>
<maml:description>
<maml:para>Specifies the number of last documents to be returned. Non positive values are ignored.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Modes</maml:name>
<maml:description>
<maml:para>Additional query options. See the driver manual.</maml:para>
<maml:para>Values : None, TailableCursor, SlaveOk, NoCursorTimeout, AwaitData, Exhaust, Partial</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>New</maml:name>
<maml:description>
<maml:para>Tells to return new documents on Update. By default old documents are returned.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<maml:description>
<maml:para>Subset of fields to be retrieved. Note that the field _id is always included unless it is explicitly excluded.
 
The argument is either strings specifying fields to be included or a single IMongoFields object which provides more options on selection of fields and their data (Include, Exclude, Slice, ElemMatch).</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Remove</maml:name>
<maml:description>
<maml:para>Tells to remove and get the first document specified by Query and SortBy.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>ResultVariable</maml:name>
<maml:description>
<maml:para>Tells to store the update result as a variable with the specified name. The result object properties: DocumentsAffected (long), UpdatedExisting (bool).</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Skip</maml:name>
<maml:description>
<maml:para>Specifies the number of documents to skip from the beginning or from the end if Last is specified. Skipping is applied to results before taking First or Last. Non positive values are ignored.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SortBy</maml:name>
<maml:description>
<maml:para>Specifies sorting field names and directions. Values are either field names or hashtables with single entries @{Field = &lt;Boolean&gt;}. $true and $false or their equivalents are for ascending and descending sorting.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Update</maml:name>
<maml:description>
<maml:para>Specifies an update expression and tells to update and get the first document specified by Query and SortBy (FindAndModify method).</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>Int64</maml:name>
</dev:type>
<maml:description>
<maml:para>If Count or Size is requested.</maml:para>
</maml:description>
</command:returnValue>
<command:returnValue>
<dev:type>
<maml:name>object</maml:name>
</dev:type>
<maml:description>
<maml:para>If the Distinct field name is specified.</maml:para>
</maml:description>
</command:returnValue>
<command:returnValue>
<dev:type>
<maml:name>Mdbc.Dictionary or custom objects</maml:name>
</dev:type>
<maml:description>
<maml:para>Documents, see New-MdbcData about Mdbc.Dictionary.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Connect-Mdbc</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>New-MdbcQuery</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Remove-MdbcData</command:name>
<maml:description>
<maml:para>Removes specified documents from the collection.</maml:para>
</maml:description>
<command:verb>Remove</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>Removes specified documents from the collection.</maml:para>
<maml:para>In order to output command result objects from a server use the switch Result.
 
Depending on operations some server exceptions are caught and written as not terminating errors, i.e. processing of remaining pipelined objects continues.
 
Parameters ErrorAction and variables $ErrorActionPreference are used to alter error actions. See help about_CommonParameters and about_Preference_Variables.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Remove-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>WriteConcern</maml:name>
<command:parameterValue required="true">WriteConcern</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>One</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Result</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" pipelineInput="true (ByValue)" position="1" >
<maml:name>Query</maml:name>
<maml:description>
<maml:para>Specifies documents to be processed. The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
<maml:para>The parameter is mandatory and does not accept nulls. In order to specify all documents use an empty query, e.g. @{}. Note that an empty string implies @{_id=&apos;&apos;}, not @{}.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object. It is obtained by Connect-Mdbc, Open-MdbcFile, or using the driver methods, for example from a database instance. If it is not specified then the variable Collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>One</maml:name>
<maml:description>
<maml:para>Tells to remove one document. By default the command removes all matching documents. Note that this is different to default Update-MdbcData and the difference is kept in order to follow the driver API.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Result</maml:name>
<maml:description>
<maml:para>Tells to output an object returned by the driver.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>WriteConcern</maml:name>
<maml:description>
<maml:para>Write concern options.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>[MongoDB.Driver.IMongoQuery]</maml:name>
</dev:type>
<maml:description>
<maml:para>Query expression. See New-MdbcQuery (query).</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>A document which _id is used for identification. Documents are created by New-MdbcData or obtained by Get-MdbcData.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[object]</maml:name>
</dev:type>
<maml:description>
<maml:para>Other values are treated as requested _id values.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[MongoDB.Driver.WriteConcernResult]</maml:name>
</dev:type>
<maml:description>
<maml:para>Result object from the driver is written if the switch Result is present.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Connect-Mdbc</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>New-MdbcQuery</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Update-MdbcData</command:name>
<maml:description>
<maml:para>Updates the specified documents.</maml:para>
</maml:description>
<command:verb>Update</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>Applies the specified update to documents matching the specified query.</maml:para>
<maml:para>In order to output command result objects from a server use the switch Result.
 
Depending on operations some server exceptions are caught and written as not terminating errors, i.e. processing of remaining pipelined objects continues.
 
Parameters ErrorAction and variables $ErrorActionPreference are used to alter error actions. See help about_CommonParameters and about_Preference_Variables.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Update-MdbcData</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Update</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>WriteConcern</maml:name>
<command:parameterValue required="true">WriteConcern</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Add</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>All</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Result</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>Update</maml:name>
<maml:description>
<maml:para>One or more update expressions either created by New-MdbcUpdate or hashtables representing JSON-like updates. Two and more expression are combined together internally.
 
The parameter is mandatory and does not accept nulls.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" pipelineInput="true (ByValue)" position="2" >
<maml:name>Query</maml:name>
<maml:description>
<maml:para>Specifies documents to be processed. The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
<maml:para>The parameter is mandatory and does not accept nulls. In order to specify all documents use an empty query, e.g. @{}. Note that an empty string implies @{_id=&apos;&apos;}, not @{}.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Add</maml:name>
<maml:description>
<maml:para>Tells to add a document based on the update and query if nothing was updated.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>All</maml:name>
<maml:description>
<maml:para>Tells to update all matching documents. By default one is updated. Note that this is different to default Remove-MdbcData and the difference is kept in order to follow the driver API.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object. It is obtained by Connect-Mdbc, Open-MdbcFile, or using the driver methods, for example from a database instance. If it is not specified then the variable Collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Result</maml:name>
<maml:description>
<maml:para>Tells to output an object returned by the driver.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>WriteConcern</maml:name>
<maml:description>
<maml:para>Write concern options.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>[MongoDB.Driver.IMongoQuery]</maml:name>
</dev:type>
<maml:description>
<maml:para>Query expression. See New-MdbcQuery (query).</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>A document which _id is used for identification. Documents are created by New-MdbcData or obtained by Get-MdbcData.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[object]</maml:name>
</dev:type>
<maml:description>
<maml:para>Other values are treated as requested _id values.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[MongoDB.Driver.WriteConcernResult]</maml:name>
</dev:type>
<maml:description>
<maml:para>Result object from the driver is written if the switch Result is present.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Connect-Mdbc</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>New-MdbcUpdate</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Add-MdbcCollection</command:name>
<maml:description>
<maml:para>Creates a new collection in a database.</maml:para>
</maml:description>
<command:verb>Add</command:verb>
<command:noun>MdbcCollection</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlet is needed only for creation of collections with extra options, like capped collections. Ordinary collections do not have to be added explicitly.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Add-MdbcCollection</maml:name>
<command:parameter required="true" position="1" >
<maml:name>Name</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Database</maml:name>
<command:parameterValue required="true">MongoDatabase</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>MaxDocuments</maml:name>
<command:parameterValue required="true">Int64</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>MaxSize</maml:name>
<command:parameterValue required="true">Int64</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="1" >
<maml:name>Name</maml:name>
<maml:description>
<maml:para>The name of a new collection.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Database</maml:name>
<maml:description>
<maml:para>The database instance. If it is not specified then the variable Database is used: it is defined by Connect-Mdbc or assigned explicitly before the call.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>MaxDocuments</maml:name>
<maml:description>
<maml:para>Sets the max number of documents in a capped collection in addition to MaxSize.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>MaxSize</maml:name>
<maml:description>
<maml:para>Sets the max size of a capped collection.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Invoke-MdbcCommand</command:name>
<maml:description>
<maml:para>Invokes a command for a database.</maml:para>
</maml:description>
<command:verb>Invoke</command:verb>
<command:noun>MdbcCommand</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlet is normally used in order to invoke commands not covered by the driver or the module. See MongoDB manuals for available commands and their parameters.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Invoke-MdbcCommand</maml:name>
<command:parameter required="true" position="1" >
<maml:name>Command</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>Value</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Database</maml:name>
<command:parameterValue required="true">MongoDatabase</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="1" >
<maml:name>Command</maml:name>
<maml:description>
<maml:para>Either the name of a command with no arguments or one argument or a JSON-like hashtable that defines a more complex command, for example:
 
    Invoke-MdbcCommand @{create=&apos;test&apos;; capped=$true; size=1kb; max=5 }
 
If the element order in a command is important then hashtables may not work. Use Mdbc.Dictionary instead:
 
    $c = New-MdbcData
    $c.create = &apos;test&apos;
    $c.capped = $true
    $c.size = 1kb
    $c.max = 5
    Invoke-MdbcCommand $c</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>Value</maml:name>
<maml:description>
<maml:para>The argument value required by a command with one argument.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Database</maml:name>
<maml:description>
<maml:para>The database instance. If it is not specified then the variable Database is used: it is defined by Connect-Mdbc or assigned explicitly before the call.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>Mdbc.Dictionary</maml:name>
</dev:type>
<maml:description>
<maml:para>The response document wrapped by Mdbc.Dictionary.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># Invoke the command `serverStatus` just by name.
 
Connect-Mdbc . test
Invoke-MdbcCommand serverStatus</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code># Connect to the database `test` and invoke the command with a
# single parameter `global` with the `admin` database specified
# explicitly (because the current is `test` and the command is
# admin-only)
 
Connect-Mdbc . test
Invoke-MdbcCommand getLog global -Database $Server[&apos;admin&apos;]</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
<dev:code># The example command creates a capped collection with maximum
# set to 5 documents, adds 10 documents, then gets all back (5
# documents are expected).
 
Connect-Mdbc . test test -NewCollection
 
$c = New-MdbcData
$c.create = &apos;test&apos;
$c.capped = $true
$c.size = 1kb
$c.max = 5
 
$null = Invoke-MdbcCommand $c
 
# set the default collection
$Collection = $Database[&apos;test&apos;]
 
# add 10 documents
1..10 | .{process{ @{_id = $_} }} | Add-MdbcData
 
# get 5 documents
Get-MdbcData</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>MongoDB</maml:linkText>
<maml:uri>http://www.mongodb.org</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Invoke-MdbcAggregate</command:name>
<maml:description>
<maml:para>Invokes aggregate operations and outputs result documents.</maml:para>
</maml:description>
<command:verb>Invoke</command:verb>
<command:noun>MdbcAggregate</command:noun>
</command:details>
<maml:description>
<maml:para>The driver currently provides just a raw API for aggregate operations. So does this cmdlet. When the API change the cmdlet will be redesigned.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Invoke-MdbcAggregate</maml:name>
<command:parameter required="true" position="1" >
<maml:name>Pipeline</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BatchSize</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>MaxTime</maml:name>
<command:parameterValue required="true">TimeSpan</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>AllowDiskUse</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="1" >
<maml:name>Pipeline</maml:name>
<maml:description>
<maml:para>One or more aggregation pipeline operations represented by JSON-like hashtables.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>AllowDiskUse</maml:name>
<maml:description>
<maml:para>Tells to allow disk use.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>BatchSize</maml:name>
<maml:description>
<maml:para>Specifies the size of a batch when using a cursor.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object. It is obtained by Connect-Mdbc, Open-MdbcFile, or using the driver methods, for example from a database instance. If it is not specified then the variable Collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>MaxTime</maml:name>
<maml:description>
<maml:para>Specifies the max time the server should spend on the aggregation command.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Result documents.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># Data: current process names and memory working sets
Connect-Mdbc . test test -NewCollection
Get-Process | Add-MdbcData -Property Name, WorkingSet
 
# Group by names, count, sum memory, get top 3
Invoke-MdbcAggregate @(
    @{ &apos;$group&apos; = @{
        _id = &apos;$Name&apos;
        Count = @{ &apos;$sum&apos; = 1 }
        Memory = @{ &apos;$sum&apos; = &apos;$WorkingSet&apos; }
    }}
    @{ &apos;$sort&apos; = @{Memory = -1} }
    @{ &apos;$limit&apos; = 3 }
)</dev:code>
</command:example>
</command:examples>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Invoke-MdbcMapReduce</command:name>
<maml:description>
<maml:para>Invokes a Map/Reduce command.</maml:para>
</maml:description>
<command:verb>Invoke</command:verb>
<command:noun>MdbcMapReduce</command:noun>
</command:details>
<maml:description>
<maml:para>Invokes a Map/Reduce command.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Invoke-MdbcMapReduce</maml:name>
<command:parameter required="true" position="1" >
<maml:name>Function</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>Query</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>First</maml:name>
<command:parameterValue required="true">Int32</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>OutCollection</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>OutDatabase</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>OutMode</maml:name>
<command:parameterValue required="true">MapReduceOutputMode</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>ResultVariable</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Scope</maml:name>
<command:parameterValue required="true">IDictionary</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SortBy</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>JSMode</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="1" >
<maml:name>Function</maml:name>
<maml:description>
<maml:para>Two (Map and Reduce) or three (Map, Reduce, Finalize) JavaScript snippets which define the functions. Use Scope in order to set variables that can be used in the functions.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>Query</maml:name>
<maml:description>
<maml:para>Specifies documents to be processed. The following types are used as or converted to queries: IMongoQuery (created by New-MdbcQuery), Mdbc.Dictionary, BsonDocument, JSON-like hashtables. Other values are treated as _id and converted to _id queries.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<maml:description>
<maml:para>Specifies the representation of output documents. The argument is either a required type or a shortcut enum value for special types.
 
A type specifies the output type literally. Type properties must match the document fields or the custom type serialization must be registered.
 
Shortcuts, either enum values or strings:
 
    Default
        Default output, Mdbc.Dictionary with underlying BsonDocument.
 
    Lazy
        Mdbc.LazyDictionary with underlying LazyBsonDocument.
        Call Dispose() after use.
 
    Raw
        Mdbc.RawDictionary with underlying RawBsonDocument.
        Read only. Call Dispose() after use.
 
    PS
        PowerShell custom object.
 
By default result documents are represented by Mdbc.Dictionary with underlying BsonDocument. See New-MdbcData for details. Use of its Lazy or Raw form may improve performance in some cases.
 
In some scenarios other output types may be suitable like native .NET types (-As ([Type])) and PowerShell custom objects (-As PS).
 
On choosing an output type keep in mind that Mdbc.Dictionary (BsonDocument) field names are case sensitive unlike object properties in PowerShell.</maml:para>
<maml:para>This parameter is used with inline output.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object. It is obtained by Connect-Mdbc, Open-MdbcFile, or using the driver methods, for example from a database instance. If it is not specified then the variable Collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>First</maml:name>
<maml:description>
<maml:para>The maximum number of input documents. It is used together with Query and normally with SortBy.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>JSMode</maml:name>
<maml:description>
<maml:para>Tells to use JS mode which avoids some conversions BSON &lt;-&gt; JS. The execution time may be significantly reduced. Note that this mode is limited by JS heap size and a maximum of 500k unique keys.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>OutCollection</maml:name>
<maml:description>
<maml:para>Name of the output collection. If it is omitted then inline output mode is used, result documents are written to the output directly.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>OutDatabase</maml:name>
<maml:description>
<maml:para>Name of the output database, used together with Collection. By default the database of the input collection is used.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>OutMode</maml:name>
<maml:description>
<maml:para>Specifies the output mode, used together with Collection. The default value is Replace (all the existing data are replaced with new). Other valid values are Merge and Reduce. Merge: new data are either added or replace existing data with the same keys. Reduce: the Reduce function is applied.</maml:para>
<maml:para>Values : Inline, Replace, Merge, Reduce</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>ResultVariable</maml:name>
<maml:description>
<maml:para>Tells to get the result object as a variable with the specified name. The result object type is MapReduceResult. Some properties: Ok, ErrorMessage, InputCount, EmitCount, OutputCount, Duration.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Scope</maml:name>
<maml:description>
<maml:para>Specifies the variables that can be used by Map, Reduce, and Finalize functions.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>SortBy</maml:name>
<maml:description>
<maml:para>Specifies sorting field names and directions. Values are either field names or hashtables with single entries @{Field = &lt;Boolean&gt;}. $true and $false or their equivalents are for ascending and descending sorting.</maml:para>
<maml:para>This parameter is used together with Query.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>Mdbc.Dictionary or custom objects</maml:name>
</dev:type>
<maml:description>
<maml:para>Result documents of Map/Reduce on inline output.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>MongoDB</maml:linkText>
<maml:uri>http://www.mongodb.org</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Export-MdbcData</command:name>
<maml:description>
<maml:para>Exports objects to a BSON file.</maml:para>
</maml:description>
<command:verb>Export</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet writes BSON representation of input objects to the specified file. The output file has the same format as .bson files produced by mongodump.exe.
 
Cmdlets Export-MdbcData and Import-MdbcData do not need any database connection or even MongoDB installed. They are used for file based object persistence on their own.
 
Files created by Export-MdbcData may be opened as collections by Open-MdbcFile with some caveats. Documents should not contain invalid names *.* and $*. If documents do not have unique _id&apos;s then the switch Simple should be used.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Export-MdbcData</maml:name>
<command:parameter required="true" position="1" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="2" >
<maml:name>InputObject</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Convert</maml:name>
<command:parameterValue required="true">ScriptBlock</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<command:parameterValue required="true">FileFormat</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Id</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Retry</maml:name>
<command:parameterValue required="true">TimeSpan[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Append</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewId</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="1" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the path to the file where BSON representation of objects will be stored.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" pipelineInput="true (ByValue)" position="2" >
<maml:name>InputObject</maml:name>
<maml:description>
<maml:para>Document or a similar object, see INPUTS.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Append</maml:name>
<maml:description>
<maml:para>Tells to append data to the file if it exists.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Convert</maml:name>
<maml:description>
<maml:para>A script called on exceptions during conversion of unknown data to BsonValue. The variable $_ is the problem object to be converted. The script returns a single value to be tried instead or nothing for nulls.
 
Examples: {} converts unknown data to nulls. {&quot;$_&quot;} converts data to strings, it is useful for preserving as much information as possible on dumping objects for later analysis.
 
Converters should be used sparingly, normally with unknown or varying data. Consider to use Property for selecting standard and converting not standard known data.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<maml:description>
<maml:para>Specifies the data file format:
 
     Bson
         BSON format
 
     Json
         JSON format
 
     Auto (default)
         The format is defined by the file extension: &quot;.json&quot; is for JSON,
         other extensions are for BSON.
 
Input JSON is a sequence of objects and arrays of objects. Arrays are unrolled. Top objects and arrays are optionally separated by spaces, tabs, and new lines.</maml:para>
<maml:para>Values : Auto, Bson, Json</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Id</maml:name>
<maml:description>
<maml:para>The document _id value to be assigned or a script block returning this value for the input object represented by the variable $_.
 
_id must not exist in input objects or be specified again by Property.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewId</maml:name>
<maml:description>
<maml:para>Tells to generate and assign a new document _id as MongoDB.Bson.ObjectId.
 
_id must not exist in input objects or be specified again by Property.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<maml:description>
<maml:para>Specifies properties or keys which values are to be included into documents or defines calculated fields. Missing input properties and keys are ignored.
 
Arguments are defined in three ways:
 
1. Strings define property or key names and the corresponding result document field names.
 
2. Hashtables @{Key=Value} define renamed and calculated fields. The key is a new document field name. The value is either a string (input object property name) or a script block (field value calculated from the input object $_).
 
3. Hashtables @{Name=...; Expression=...} or @{Label=...; Expression=...} are similar but use the same convention as the parameter Property of Select-Object.
 
See New-MdbcData examples.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Retry</maml:name>
<maml:description>
<maml:para>Tells to retry on failures to open the file and specifies one or two arguments. The first is the retry timeout. The second is the retry interval, the default is 50 milliseconds.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>$null</maml:name>
</dev:type>
<maml:description>
<maml:para>Null is converted to an empty document by New-MdbcData and ignored by Add-MdbcData and Export-MdbcData.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects created by New-MdbcData or obtained by Get-MdbcData or Import-MdbcData. This type is the most effective and safe as input/output of Mdbc data cmdlets.
 
The native driver document [MongoDB.Bson.BsonDocument] can be used as well but normally it should not be used directly. Its wrapper [Mdbc.Dictionary] is more suitable in PowerShell.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[IDictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Dictionaries are converted to new documents. Keys are strings used as new field names. Collection, dictionary, and custom object values are converted to BSON container types recursively. Other values are converted to BsonValue.</maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[PSObject]</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects are converted to new documents. Property names are used as new field names. Collection, dictionary, and custom object values are converted to BSON container types recursively. Other values are converted to BsonValue.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>@{ p1 = &apos;Name1&apos;; p2 = 42 }, @{ p1 = &apos;Name2&apos;; p2 = 3.14 } | Export-MdbcData test.bson
Import-MdbcData test.bson -As PS</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code># &quot;Safe&quot; logging by several writers
$data | Export-MdbcData $file -Append -Retry ([TimeSpan]::FromSeconds(10))</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Import-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Open-MdbcFile</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Save-MdbcFile</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Import-MdbcData</command:name>
<maml:description>
<maml:para>Imports data from a file.</maml:para>
</maml:description>
<command:verb>Import</command:verb>
<command:noun>MdbcData</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet reads data from a BSON file. Such files are produced, for example, by the cmdlet Export-MdbcData or by the utility mongodump.exe.
 
Cmdlets Export-MdbcData and Import-MdbcData do not need any database connection or even MongoDB installed. They are used for file based object persistence on their own.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Import-MdbcData</maml:name>
<command:parameter required="true" position="1" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<command:parameterValue required="true">PSObject</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<command:parameterValue required="true">FileFormat</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="1" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the path to the BSON file where objects will be restored from.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>As</maml:name>
<maml:description>
<maml:para>Specifies the representation of output documents. The argument is either a required type or a shortcut enum value for special types.
 
A type specifies the output type literally. Type properties must match the document fields or the custom type serialization must be registered.
 
Shortcuts, either enum values or strings:
 
    Default
        Default output, Mdbc.Dictionary with underlying BsonDocument.
 
    Lazy
        Mdbc.LazyDictionary with underlying LazyBsonDocument.
        Call Dispose() after use.
 
    Raw
        Mdbc.RawDictionary with underlying RawBsonDocument.
        Read only. Call Dispose() after use.
 
    PS
        PowerShell custom object.
 
By default result documents are represented by Mdbc.Dictionary with underlying BsonDocument. See New-MdbcData for details. Use of its Lazy or Raw form may improve performance in some cases.
 
In some scenarios other output types may be suitable like native .NET types (-As ([Type])) and PowerShell custom objects (-As PS).
 
On choosing an output type keep in mind that Mdbc.Dictionary (BsonDocument) field names are case sensitive unlike object properties in PowerShell.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<maml:description>
<maml:para>Specifies the data file format:
 
     Bson
         BSON format
 
     Json
         JSON format
 
     Auto (default)
         The format is defined by the file extension: &quot;.json&quot; is for JSON,
         other extensions are for BSON.
 
Input JSON is a sequence of objects and arrays of objects. Arrays are unrolled. Top objects and arrays are optionally separated by spaces, tabs, and new lines.</maml:para>
<maml:para>Values : Auto, Bson, Json</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[Mdbc.Dictionary]</maml:name>
</dev:type>
<maml:description>
<maml:para>Default, Lazy, or Raw form depending on the parameter As.</maml:para>
</maml:description>
</command:returnValue>
<command:returnValue>
<dev:type>
<maml:name>[object]</maml:name>
</dev:type>
<maml:description>
<maml:para>Custom objects specified by the parameter As.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>@{ p1 = &apos;Name1&apos;; p2 = 42 }, @{ p1 = &apos;Name2&apos;; p2 = 3.14 } | Export-MdbcData test.bson
Import-MdbcData test.bson -As PS</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code># Import data produced by ConvertTo-Json (PowerShell V3)
Get-Process | ConvertTo-Json | Set-Content process.json
Import-MdbcData process.json</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Export-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Open-MdbcFile</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Save-MdbcFile</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Open-MdbcFile</command:name>
<maml:description>
<maml:para>Opens a bson file as a collection.</maml:para>
</maml:description>
<command:verb>Open</command:verb>
<command:noun>MdbcFile</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlet opens a bson file as a collection for operations Get-MdbcData, Add-MdbcData, Remove-MdbcData, and Update-MdbcData. Save-MdbcFile is used in order to save data to the source file or another file. Such scenarios do not require MongoDB running or even installed.
 
NORMAL AND SIMPLE DATA
 
In the normal mode which is the default documents in a file must have unique _id&apos;s. If new documents have no _id&apos;s then they are generated on insertions.
 
The simple mode is specified by the switch Simple. Presence and uniqueness of document _id&apos;s is not maintained. Operations like Add-MdbcData -Update are not supported.
 
INVALID ELEMENT NAMES
 
Document element names like *.* and $* are invalid in collections because query and update expressions use the dot notation for nested items and special names $* for operators.
 
Nevertheless Open-MdbcFile does not perform name checks on reading assuming that the file was created and maintained only by cmdlets listed above and it contains valid names.
 
Remember that files created in a different way, for example by Export-MdbcData, may contain problematic names for using them as collections with Open-MdbcFile.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Open-MdbcFile</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>CollectionVariable</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<command:parameterValue required="true">FileFormat</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewCollection</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Simple</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the bson file path. If the file does not exists then the collection is empty and the file is not created until it is saved. If the path is omitted or empty then the collection is empty and Save-MdbcFile will require a path.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>CollectionVariable</maml:name>
<maml:description>
<maml:para>Name of a new variable in the current scope with the connected collection. The default variable name is Collection. The default variable is used implicitly by cmdlets operating on collection data.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<maml:description>
<maml:para>Specifies the data file format:
 
     Bson
         BSON format
 
     Json
         JSON format
 
     Auto (default)
         The format is defined by the file extension: &quot;.json&quot; is for JSON,
         other extensions are for BSON.
 
Input JSON is a sequence of objects and arrays of objects. Arrays are unrolled. Top objects and arrays are optionally separated by spaces, tabs, and new lines.</maml:para>
<maml:para>Values : Auto, Bson, Json</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>NewCollection</maml:name>
<maml:description>
<maml:para>Tells to open an empty collection. If the source file path is specified then it is simply stored for saving, the source file is not touched at this moment.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Simple</maml:name>
<maml:description>
<maml:para>Tells to operate on simple data, i.e. do not maintain presence and uniqueness of document _id&apos;s. Some operations like Add-MdbcData -Update are not supported.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># Open existing or new bson file collection
Open-MdbcFile data.bson
 
# Use Get-MdbcData, Add-MdbcData, Remove-MdbcData, Update-MdbcData
# ...
 
# Save data
Save-MdbcFile</dev:code>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code># Open and query data produced by ConvertTo-Json (PowerShell V3)
Get-Process | ConvertTo-Json -Depth 1 | Set-Content process.json
Open-MdbcFile process.json -Simple
Get-MdbcData @{Name=&apos;mongod&apos;}</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Save-MdbcFile</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Get-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Add-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Remove-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Update-MdbcData</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Save-MdbcFile</command:name>
<maml:description>
<maml:para>Saves data to a bson file.</maml:para>
</maml:description>
<command:verb>Save</command:verb>
<command:noun>MdbcFile</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlet saves the collection data to the specified or the original file.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Save-MdbcFile</maml:name>
<command:parameter required="false" position="1" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<command:parameterValue required="true">Object</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<command:parameterValue required="true">FileFormat</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="1" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the bson file path for saving data. If it is omitted or empty then the path used on opening is assumed. If it was not provided as well then an error is thrown.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Collection</maml:name>
<maml:description>
<maml:para>Collection object created by Open-MdbcFile. If it is omitted then the variable Collection is used which is assumed to be created by Open-MdbcFile by default.
 
It is not an error to call this cmdlet for a native driver collection. Such a call is simply ignored.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>FileFormat</maml:name>
<maml:description>
<maml:para>Specifies the data file format:
 
     Bson
         BSON format
 
     Json
         JSON format
 
     Auto (default)
         The format is defined by the file extension: &quot;.json&quot; is for JSON,
         other extensions are for BSON.
 
Input JSON is a sequence of objects and arrays of objects. Arrays are unrolled. Top objects and arrays are optionally separated by spaces, tabs, and new lines.</maml:para>
<maml:para>This parameter is ignored if the path is omitted or empty.</maml:para>
<maml:para>Values : Auto, Bson, Json</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># Open existing or new bson file collection
Open-MdbcFile data.bson
 
# Use Get-MdbcData, Add-MdbcData, Remove-MdbcData, Update-MdbcData
# ...
 
# Save data
Save-MdbcFile</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Open-MdbcFile</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Get-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Add-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Remove-MdbcData</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Update-MdbcData</maml:linkText>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
</helpItems>