@cli4ai/mongodb 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/{c4ai.json → cli4ai.json} +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
# @cli4ai/mongodb
|
|
2
2
|
|
|
3
|
-
> Official @cli4ai package • https://cli4ai.com • Install
|
|
3
|
+
> Official @cli4ai package • https://cli4ai.com • Install cli4ai: `npm i -g cli4ai`
|
|
4
4
|
|
|
5
5
|
MongoDB explorer and query helper (JSON in/out).
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm i -g
|
|
11
|
-
|
|
10
|
+
npm i -g cli4ai
|
|
11
|
+
cli4ai add -g mongodb
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Optional: set a default connection URI (defaults to `mongodb://localhost:27017`):
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
|
|
17
|
+
cli4ai secrets set MONGO_URI
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Commands
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
cli4ai run mongodb databases
|
|
24
|
+
cli4ai run mongodb collections <db>
|
|
25
|
+
cli4ai run mongodb schema <db> <collection> [samples]
|
|
26
|
+
cli4ai run mongodb find <db> <collection> [queryJson] [limit]
|
|
27
|
+
cli4ai run mongodb one <db> <collection> [queryJson]
|
|
28
|
+
cli4ai run mongodb aggregate <db> <collection> <pipelineJson>
|
|
29
|
+
cli4ai run mongodb count <db> <collection> [queryJson]
|
|
30
|
+
cli4ai run mongodb indexes <db> <collection>
|
|
31
|
+
cli4ai run mongodb stats <db> <collection>
|
|
32
|
+
cli4ai run mongodb distinct <db> <collection> <field> [queryJson]
|
|
33
|
+
cli4ai run mongodb sample <db> <collection> [size]
|
|
34
|
+
cli4ai run mongodb explain <db> <collection> [queryJson]
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Examples
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
# List databases
|
|
41
|
-
|
|
41
|
+
cli4ai run mongodb databases
|
|
42
42
|
|
|
43
43
|
# Find recent users (query/pipeline args are JSON)
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
cli4ai run mongodb find app users '{"status":"active"}' 10
|
|
45
|
+
cli4ai run mongodb aggregate app events '[{"$match":{"type":"signup"}},{"$limit":5}]'
|
|
46
46
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cli4ai/mongodb",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "MongoDB queries",
|
|
5
5
|
"author": "cliforai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"keywords": [
|
|
13
|
-
"
|
|
13
|
+
"cli4ai",
|
|
14
14
|
"cli",
|
|
15
15
|
"ai-tools",
|
|
16
16
|
"mongodb",
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
],
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "https://github.com/
|
|
23
|
+
"url": "https://github.com/cliforai/packages",
|
|
24
24
|
"directory": "packages/mongodb"
|
|
25
25
|
},
|
|
26
|
-
"homepage": "https://github.com/
|
|
26
|
+
"homepage": "https://github.com/cliforai/packages/tree/main/packages/mongodb",
|
|
27
27
|
"bugs": {
|
|
28
|
-
"url": "https://github.com/
|
|
28
|
+
"url": "https://github.com/cliforai/packages/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@cli4ai/lib": "^1.0.
|
|
32
|
-
"
|
|
33
|
-
"
|
|
31
|
+
"@cli4ai/lib": "^1.0.2",
|
|
32
|
+
"mongodb": "^6.0.0",
|
|
33
|
+
"commander": "^14.0.0"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"run.ts",
|
|
37
|
-
"
|
|
37
|
+
"cli4ai.json",
|
|
38
38
|
"README.md",
|
|
39
39
|
"LICENSE"
|
|
40
40
|
],
|