@atscript/mongo 0.1.34 → 0.1.36
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/LICENSE +1 -1
- package/dist/index.cjs +725 -196
- package/dist/index.d.ts +114 -56
- package/dist/index.mjs +727 -198
- package/dist/plugin.cjs +16 -0
- package/dist/plugin.mjs +16 -0
- package/package.json +5 -5
package/dist/plugin.cjs
CHANGED
|
@@ -82,6 +82,22 @@ const annotations = {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
}),
|
|
85
|
+
capped: new __atscript_core.AnnotationSpec({
|
|
86
|
+
description: "Creates a **capped collection** with a fixed maximum size.\n\n- Capped collections have fixed size and maintain insertion order.\n- Ideal for logs, event streams, and cache-like data.\n- Changing the cap size requires dropping and recreating the collection — use `@db.sync.method \"drop\"` to allow this.\n\n**Example:**\n```atscript\n@db.table \"logs\"\n@db.mongo.collection\n@db.mongo.capped 10485760, 10000\n@db.sync.method \"drop\"\nexport interface LogEntry {\n message: string\n timestamp: number\n}\n```\n",
|
|
87
|
+
nodeType: ["interface"],
|
|
88
|
+
multiple: false,
|
|
89
|
+
argument: [{
|
|
90
|
+
optional: false,
|
|
91
|
+
name: "size",
|
|
92
|
+
type: "number",
|
|
93
|
+
description: "Maximum size of the collection in **bytes**."
|
|
94
|
+
}, {
|
|
95
|
+
optional: true,
|
|
96
|
+
name: "max",
|
|
97
|
+
type: "number",
|
|
98
|
+
description: "Maximum number of documents in the collection. If omitted, only the byte size limit applies."
|
|
99
|
+
}]
|
|
100
|
+
}),
|
|
85
101
|
search: {
|
|
86
102
|
dynamic: new __atscript_core.AnnotationSpec({
|
|
87
103
|
description: "Creates a **dynamic MongoDB Search Index** that applies to the entire collection.\n\n- **Indexes all text fields automatically** (no need to specify fields).\n- Supports **language analyzers** for text tokenization.\n- Enables **fuzzy search** (typo tolerance) if needed.\n\n**Example:**\n```atscript\n@db.mongo.search.dynamic \"lucene.english\", 1\nexport interface MongoCollection {}\n```\n",
|
package/dist/plugin.mjs
CHANGED
|
@@ -58,6 +58,22 @@ const annotations = {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
}),
|
|
61
|
+
capped: new AnnotationSpec({
|
|
62
|
+
description: "Creates a **capped collection** with a fixed maximum size.\n\n- Capped collections have fixed size and maintain insertion order.\n- Ideal for logs, event streams, and cache-like data.\n- Changing the cap size requires dropping and recreating the collection — use `@db.sync.method \"drop\"` to allow this.\n\n**Example:**\n```atscript\n@db.table \"logs\"\n@db.mongo.collection\n@db.mongo.capped 10485760, 10000\n@db.sync.method \"drop\"\nexport interface LogEntry {\n message: string\n timestamp: number\n}\n```\n",
|
|
63
|
+
nodeType: ["interface"],
|
|
64
|
+
multiple: false,
|
|
65
|
+
argument: [{
|
|
66
|
+
optional: false,
|
|
67
|
+
name: "size",
|
|
68
|
+
type: "number",
|
|
69
|
+
description: "Maximum size of the collection in **bytes**."
|
|
70
|
+
}, {
|
|
71
|
+
optional: true,
|
|
72
|
+
name: "max",
|
|
73
|
+
type: "number",
|
|
74
|
+
description: "Maximum number of documents in the collection. If omitted, only the byte size limit applies."
|
|
75
|
+
}]
|
|
76
|
+
}),
|
|
61
77
|
search: {
|
|
62
78
|
dynamic: new AnnotationSpec({
|
|
63
79
|
description: "Creates a **dynamic MongoDB Search Index** that applies to the entire collection.\n\n- **Indexes all text fields automatically** (no need to specify fields).\n- Supports **language analyzers** for text tokenization.\n- Enables **fuzzy search** (typo tolerance) if needed.\n\n**Example:**\n```atscript\n@db.mongo.search.dynamic \"lucene.english\", 1\nexport interface MongoCollection {}\n```\n",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/mongo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"description": "Mongodb plugin for atscript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/moostjs/atscript/issues"
|
|
13
13
|
},
|
|
14
|
-
"license": "
|
|
14
|
+
"license": "MIT",
|
|
15
15
|
"author": "Artem Maltsev",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"mongodb": "^6.17.0",
|
|
60
|
-
"@atscript/core": "^0.1.
|
|
61
|
-
"@atscript/typescript": "^0.1.
|
|
62
|
-
"@atscript/utils-db": "^0.1.
|
|
60
|
+
"@atscript/core": "^0.1.36",
|
|
61
|
+
"@atscript/typescript": "^0.1.36",
|
|
62
|
+
"@atscript/utils-db": "^0.1.36"
|
|
63
63
|
},
|
|
64
64
|
"build": [
|
|
65
65
|
{},
|