-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
98 lines (84 loc) · 5.7 KB
/
example.html
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
<!DOCTYPE html>
<html>
<head>
<title>Shell Example</title>
<link href="https://compose.cachefly.net/stylesheets/megatron.css" rel="stylesheet" type="text/css">
<script src="https://compose.cachefly.net/javascripts/megatron.js"></script>
<link rel="stylesheet" href="dist/shell.css">
<script src="dist/compose-shell.js"></script>
<style type="text/css">
body, html {background: white;}
body {padding: .5em;}
</style>
<!--script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="./compose-shell-param.html">
<link rel="import" href="./compose-shell-button.html">
<link rel="import" href="./compose-shell.html"-->
</head>
<body>
<!-- Query a MongoDB collection -->
<compose-shell method="get">
<input type="hidden" value="blah">
<compose-shell-param name="find" before="find(" after=")">
<compose-shell-param name="find[query]" required="true" focus="true" before="{" after="}" type="hash" parser="bson"></compose-shell-param>
<compose-shell-param name="find[fields]" before=",{" after="}" type="hash" hint="Fields" parser="bson"></compose-shell-param>
</compose-shell-param>
<compose-shell-param name="sort" before=".sort({" after="})" type="hash" parser="bson"></compose-shell-param>
<compose-shell-param name="skip" before=".skip(" after=")" type="number"></compose-shell-param>
<compose-shell-param name="limit" before=".limit(" after=")" type="number" value="10"></compose-shell-param>
<compose-shell-param name="explain" type="boolean">.explain()</compose-shell-param>
<compose-shell-button toggle="find[fields]">fields{}</compose-shell-button>
<compose-shell-button toggle="sort">sort()</compose-shell-button>
<compose-shell-button toggle="skip">skip()</compose-shell-button>
<compose-shell-button toggle="explain">explain()</compose-shell-button>
<compose-shell-button type="submit">Run</compose-shell-button>
</compose-shell>
<br>
<!-- Query a MongoDB collection -->
<compose-shell method="get" action="receive.html">
<compose-shell-param name="find" required="true" before="find(" after=")">
<compose-shell-param name="find[query]" before="{" after="}" type="hash" parser="bson" value='{"_id": {"$oid": "4f6f21ed8b1e02ff593bdeb1"}}'></compose-shell-param>
<compose-shell-param name="find[fields]" before=",{" after="}" type="hash" hint="Fields" parser="bson" value='{"yo": 1}'></compose-shell-param>
</compose-shell-param>
<compose-shell-param name="sort" before=".sort({" after="})" type="hash" parser="bson"></compose-shell-param>
<compose-shell-param name="skip" before=".skip(" after=")" type="number" value="5"></compose-shell-param>
<compose-shell-param name="limit" before=".limit(" after=")" type="number" value="10"></compose-shell-param>
<compose-shell-param name="explain" type="boolean" value="1">.explain()</compose-shell-param>
<compose-shell-button toggle="find[fields]">fields{}</compose-shell-button>
<compose-shell-button toggle="sort">sort()</compose-shell-button>
<compose-shell-button toggle="skip">skip()</compose-shell-button>
<compose-shell-button toggle="explain">explain()</compose-shell-button>
<compose-shell-button type="submit">Run</compose-shell-button>
</compose-shell>
<br>
<!-- Create a MongoDB collection -->
<compose-shell method="get" on-notify="Megatron.notify">
<compose-shell-param name="name" required="true" before="createCollection(" placeholder="name" type="string"></compose-shell-param>
<compose-shell-param name="options[capped]" before=", { capped: true" after="}" optional>
<compose-shell-param name="options[size]" before=", size: " type="number"></compose-shell-param>
<compose-shell-param name="options[max]" before=", max: " type="number" dependency="options[size]"></compose-shell-param>
</compose-shell-param>
<compose-shell-param type="text">)</compose-shell-param>
<compose-shell-button toggle="options[size]">size</compose-shell-button>
<compose-shell-button toggle="options[max]">max</compose-shell-button>
<compose-shell-button type="submit">Create collection</compose-shell-button>
</compose-shell>
<br>
<!-- Create a MongoDB index -->
<compose-shell method="get" action="receive.html">
<compose-shell-param name="key" required="true" before="ensureIndex({" after="}," type="hash" parser="bson"></compose-shell-param>
<compose-shell-param name="options" before="{ " after=" })">
<compose-shell-param name="options[background]" type="boolean" required="true">background: true</compose-shell-param>
<compose-shell-param name="options[sparse]" before=", " type="boolean">sparse: true</compose-shell-param>
<compose-shell-param name="options[unique]" before=", " type="boolean">unique: true</compose-shell-param>
<compose-shell-param name="options[dropDups]" before=", " type="boolean" dependency="options[unique]">dropDups: true</compose-shell-param>
<compose-shell-param name="options[expireAfterSeconds]" before=", expireAfterSeconds: " type="number"></compose-shell-param>
</compose-shell-param>
<compose-shell-button toggle="options[sparse]">sparse</compose-shell-button>
<compose-shell-button toggle="options[unique]">unique</compose-shell-button>
<compose-shell-button toggle="options[dropDups]">dropDups</compose-shell-button>
<compose-shell-button toggle="options[expireAfterSeconds]">expireAfterSeconds</compose-shell-button>
<compose-shell-button type="submit">Create index</compose-shell-button>
</compose-shell>
</body>
</html>