axiodb 15.0.1 → 15.1.0
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 +2 -2
- package/lib/Services/Aggregation/Aggregation.Operation.d.ts +5 -44
- package/lib/Services/Aggregation/Aggregation.Operation.js +54 -214
- package/lib/Services/Aggregation/Aggregation.Operation.js.map +1 -1
- package/lib/Services/Aggregation/OperatorRegistry.d.ts +11 -0
- package/lib/Services/Aggregation/OperatorRegistry.js +35 -0
- package/lib/Services/Aggregation/OperatorRegistry.js.map +1 -0
- package/lib/Services/Aggregation/operators/accumulatorOperators.d.ts +12 -0
- package/lib/Services/Aggregation/operators/accumulatorOperators.js +138 -0
- package/lib/Services/Aggregation/operators/accumulatorOperators.js.map +1 -0
- package/lib/Services/Aggregation/operators/expressionOperators.d.ts +3 -0
- package/lib/Services/Aggregation/operators/expressionOperators.js +587 -0
- package/lib/Services/Aggregation/operators/expressionOperators.js.map +1 -0
- package/lib/Services/Aggregation/operators/stageOperators.d.ts +38 -0
- package/lib/Services/Aggregation/operators/stageOperators.js +564 -0
- package/lib/Services/Aggregation/operators/stageOperators.js.map +1 -0
- package/lib/Services/Collection/collection.operation.d.ts +3 -1
- package/lib/Services/Collection/collection.operation.js +3 -2
- package/lib/Services/Collection/collection.operation.js.map +1 -1
- package/lib/Services/Database/database.operation.d.ts +8 -0
- package/lib/Services/Database/database.operation.js +72 -1
- package/lib/Services/Database/database.operation.js.map +1 -1
- package/lib/config/DB.d.ts +5 -1
- package/lib/config/DB.js +5 -1
- package/lib/config/DB.js.map +1 -1
- package/lib/config/Interfaces/Operation/aggregation.interface.d.ts +9 -0
- package/lib/config/Interfaces/Operation/aggregation.interface.js +4 -0
- package/lib/config/Interfaces/Operation/aggregation.interface.js.map +1 -0
- package/lib/server/public/AxioControl/.vite/manifest.json +1 -1
- package/lib/server/public/AxioControl/assets/{index-DkwtNvzk.js → index-BRccHygR.js} +31 -31
- package/lib/server/public/AxioControl/index.html +1 -1
- package/lib/server/public/AxioControl/sw.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -155,7 +155,7 @@ const db = new AxioDB({
|
|
|
155
155
|
### Querying
|
|
156
156
|
- **Chainable Query API:** `.query()`, `.Sort()`, `.Limit()`, `.Skip()`, `.setCount()`, `.setProject()`, `.exec()` / `.findOne()`
|
|
157
157
|
- **MongoDB-style Query Operators:** `$gt`, `$gte`, `$lt`, `$lte`, `$ne`, `$in`, `$nin`, `$exists`, `$regex`, `$or`, `$and`
|
|
158
|
-
- **Aggregation Pipelines:** MongoDB-compatible (`$match`, `$group`, `$sort`, `$project`, `$limit`, `$skip`, `$unwind`, `$addFields`, ...)
|
|
158
|
+
- **Aggregation Pipelines:** 60+ MongoDB-compatible stages (`$match`, `$group`, `$sort`, `$project`, `$limit`, `$skip`, `$unwind`, `$addFields`, `$lookup`, `$facet`, `$bucket`, `$count`, `$sample`, ...) with full expression evaluator, cross-collection `$lookup` joins, and custom operator registration via `OperatorRegistry`
|
|
159
159
|
- **Bulk Operations:** high-performance `insertMany`, `UpdateMany`, `deleteMany`
|
|
160
160
|
|
|
161
161
|
### Indexing
|
|
@@ -882,7 +882,7 @@ For vulnerability reporting, see [SECURITY.md](SECURITY.md).
|
|
|
882
882
|
| **Built-in caching** | ❌ | ❌ | ❌ | ✅ InMemoryCache |
|
|
883
883
|
| **Worker Threads** | ❌ | ❌ | ❌ | ✅ |
|
|
884
884
|
| **ACID Transactions** | ❌ | ❌ | ✅ | ✅ |
|
|
885
|
-
| **Aggregation Pipelines** | ❌ | Partial | ❌ | ✅
|
|
885
|
+
| **Aggregation Pipelines** | ❌ | Partial | ❌ | ✅ 60+ stages, $lookup, custom operators |
|
|
886
886
|
| **TypeScript support** | ✅ | Partial | ✅ | ✅ Full |
|
|
887
887
|
| **Electron compatible** | ✅ | ✅ | ❌ (requires rebuild) | ✅ |
|
|
888
888
|
| **Sweet spot** | <5K docs | <100K docs | 10M+ (relational) | 10K–500K docs |
|
|
@@ -1,52 +1,13 @@
|
|
|
1
1
|
import { ErrorInterface, SuccessInterface } from "../../config/Interfaces/Helper/response.helper.interface";
|
|
2
|
-
|
|
3
|
-
* Class that performs aggregation operations on data.
|
|
4
|
-
*
|
|
5
|
-
* This class allows for MongoDB-like aggregation pipeline operations on collection data.
|
|
6
|
-
* It supports various stages including $match, $group, $sort, $project, $limit, $skip,
|
|
7
|
-
* $unwind, and $addFields.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
2
|
+
import { CollectionResolver } from "../../config/Interfaces/Operation/aggregation.interface";
|
|
10
3
|
export default class Aggregation {
|
|
11
4
|
private AllData;
|
|
12
5
|
private readonly Pipeline;
|
|
13
|
-
private path;
|
|
6
|
+
private readonly path;
|
|
14
7
|
private readonly collectionName;
|
|
15
8
|
private readonly ResponseHelper;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Executes the aggregation pipeline on the data.
|
|
19
|
-
*
|
|
20
|
-
* This method processes the aggregation pipeline stages in sequence:
|
|
21
|
-
* - $match: Filters documents based on specified conditions
|
|
22
|
-
* - $group: Groups documents by specified fields and applies aggregation operations
|
|
23
|
-
* - $sort: Sorts documents based on specified fields and order
|
|
24
|
-
* - $project: Reshapes documents by including specified fields
|
|
25
|
-
* - $limit: Limits the number of documents in the result
|
|
26
|
-
* - $skip: Skips a specified number of documents
|
|
27
|
-
* - $unwind: Deconstructs an array field from input documents
|
|
28
|
-
* - $addFields: Adds new fields to documents
|
|
29
|
-
*
|
|
30
|
-
* The method first validates if the pipeline is an array, loads all buffer data,
|
|
31
|
-
* and then processes each stage of the pipeline sequentially.
|
|
32
|
-
*
|
|
33
|
-
* @throws {Error} If the pipeline is not an array
|
|
34
|
-
* @returns {Array<any>} The result of the aggregation pipeline
|
|
35
|
-
*/
|
|
9
|
+
private readonly collectionResolver?;
|
|
10
|
+
constructor(collectionName: string, path: string, Pipeline: object[] | any, collectionResolver?: CollectionResolver);
|
|
36
11
|
exec(): Promise<SuccessInterface | ErrorInterface>;
|
|
37
|
-
|
|
38
|
-
* Loads all buffer raw data from the specified directory.
|
|
39
|
-
*
|
|
40
|
-
* This method performs the following steps:
|
|
41
|
-
* 1. Checks if the directory is locked.
|
|
42
|
-
* 2. If the directory is not locked, it lists all files in the directory.
|
|
43
|
-
* 3. Reads each file.
|
|
44
|
-
* 4. Stores the data in the `AllData` array.
|
|
45
|
-
* 5. If the directory is locked, it unlocks the directory, reads the files, and then locks the directory again.
|
|
46
|
-
*
|
|
47
|
-
* @returns {Promise<SuccessInterface | ErrorInterface>} A promise that resolves to a success or error response.
|
|
48
|
-
*
|
|
49
|
-
* @throws {Error} Throws an error if any operation fails.
|
|
50
|
-
*/
|
|
51
|
-
private LoadAllBufferRawData;
|
|
12
|
+
private loadSourceData;
|
|
52
13
|
}
|
|
@@ -12,253 +12,93 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
15
16
|
const response_helper_1 = __importDefault(require("../../Helper/response.helper"));
|
|
16
17
|
const DocumentLoader_helper_1 = __importDefault(require("../../Helper/DocumentLoader.helper"));
|
|
17
18
|
const Console_helper_1 = __importDefault(require("../../Helper/Console.helper"));
|
|
18
19
|
const ReadIndex_service_1 = require("../Index/ReadIndex.service");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* This class allows for MongoDB-like aggregation pipeline operations on collection data.
|
|
23
|
-
* It supports various stages including $match, $group, $sort, $project, $limit, $skip,
|
|
24
|
-
* $unwind, and $addFields.
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
20
|
+
const OperatorRegistry_1 = require("./OperatorRegistry");
|
|
21
|
+
const stageOperators_1 = require("./operators/stageOperators");
|
|
27
22
|
class Aggregation {
|
|
28
|
-
constructor(collectionName, path, Pipeline) {
|
|
29
|
-
// property to store the data
|
|
23
|
+
constructor(collectionName, path, Pipeline, collectionResolver) {
|
|
30
24
|
this.AllData = [];
|
|
31
25
|
this.collectionName = collectionName;
|
|
32
26
|
this.path = path;
|
|
33
27
|
this.AllData = [];
|
|
34
28
|
this.Pipeline = Pipeline;
|
|
35
29
|
this.ResponseHelper = new response_helper_1.default();
|
|
30
|
+
this.collectionResolver = collectionResolver;
|
|
36
31
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Executes the aggregation pipeline on the data.
|
|
39
|
-
*
|
|
40
|
-
* This method processes the aggregation pipeline stages in sequence:
|
|
41
|
-
* - $match: Filters documents based on specified conditions
|
|
42
|
-
* - $group: Groups documents by specified fields and applies aggregation operations
|
|
43
|
-
* - $sort: Sorts documents based on specified fields and order
|
|
44
|
-
* - $project: Reshapes documents by including specified fields
|
|
45
|
-
* - $limit: Limits the number of documents in the result
|
|
46
|
-
* - $skip: Skips a specified number of documents
|
|
47
|
-
* - $unwind: Deconstructs an array field from input documents
|
|
48
|
-
* - $addFields: Adds new fields to documents
|
|
49
|
-
*
|
|
50
|
-
* The method first validates if the pipeline is an array, loads all buffer data,
|
|
51
|
-
* and then processes each stage of the pipeline sequentially.
|
|
52
|
-
*
|
|
53
|
-
* @throws {Error} If the pipeline is not an array
|
|
54
|
-
* @returns {Array<any>} The result of the aggregation pipeline
|
|
55
|
-
*/
|
|
56
32
|
exec() {
|
|
57
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
34
|
if (!Array.isArray(this.Pipeline)) {
|
|
59
35
|
throw new Error("Pipeline must be an array of aggregation stages.");
|
|
60
36
|
}
|
|
61
|
-
|
|
62
|
-
throw new Error("Pipeline must have a $match operator at top");
|
|
63
|
-
}
|
|
64
|
-
if (this.Pipeline.$match) {
|
|
65
|
-
const fileNames = yield new ReadIndex_service_1.ReadIndex(this.path).getFileFromIndex(this.Pipeline.$match);
|
|
66
|
-
if (fileNames.length > 0) {
|
|
67
|
-
// Load File Names from Index
|
|
68
|
-
yield this.LoadAllBufferRawData(fileNames);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
// Load all buffer raw data from the specified directory
|
|
72
|
-
yield this.LoadAllBufferRawData().then((response) => {
|
|
73
|
-
var _a;
|
|
74
|
-
if ("data" in response) {
|
|
75
|
-
Console_helper_1.default.green(`${(_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.length} Documents Loaded for Aggregation`);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
// Load all buffer raw data from the specified directory
|
|
82
|
-
yield this.LoadAllBufferRawData().then((response) => {
|
|
83
|
-
var _a;
|
|
84
|
-
if ("data" in response) {
|
|
85
|
-
Console_helper_1.default.green(`${(_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.length} Documents Loaded for Aggregation`);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
37
|
+
yield this.loadSourceData();
|
|
89
38
|
let result = [...this.AllData];
|
|
90
39
|
for (const stage of this.Pipeline) {
|
|
91
|
-
if (stage
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
if (typeof value === "object" && value !== null) {
|
|
102
|
-
if (value instanceof RegExp) {
|
|
103
|
-
return value.test(itemValue);
|
|
104
|
-
}
|
|
105
|
-
if ("$regex" in value) {
|
|
106
|
-
const regexPattern = value.$regex;
|
|
107
|
-
const regexOptions = "$options" in value ? value.$options : "";
|
|
108
|
-
try {
|
|
109
|
-
const regex = new RegExp(String(regexPattern), regexOptions);
|
|
110
|
-
return regex.test(itemValue);
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
Console_helper_1.default.red(`Invalid regex: ${regexPattern} with options: ${regexOptions}`, error);
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// Comparison operators
|
|
118
|
-
if ("$gte" in value) {
|
|
119
|
-
return itemValue >= value.$gte;
|
|
120
|
-
}
|
|
121
|
-
if ("$gt" in value) {
|
|
122
|
-
return itemValue > value.$gt;
|
|
123
|
-
}
|
|
124
|
-
if ("$lte" in value) {
|
|
125
|
-
return itemValue <= value.$lte;
|
|
126
|
-
}
|
|
127
|
-
if ("$lt" in value) {
|
|
128
|
-
return itemValue < value.$lt;
|
|
129
|
-
}
|
|
130
|
-
if ("$ne" in value) {
|
|
131
|
-
return itemValue !== value.$ne;
|
|
132
|
-
}
|
|
133
|
-
if ("$in" in value) {
|
|
134
|
-
return Array.isArray(value.$in) && value.$in.includes(itemValue);
|
|
135
|
-
}
|
|
136
|
-
if ("$nin" in value) {
|
|
137
|
-
return Array.isArray(value.$nin) && !value.$nin.includes(itemValue);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return false;
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
if (stage.$group) {
|
|
145
|
-
const groupedData = {};
|
|
146
|
-
for (const item of result) {
|
|
147
|
-
let groupKey;
|
|
148
|
-
if (typeof stage.$group._id === "string") {
|
|
149
|
-
groupKey = stage.$group._id.startsWith("$")
|
|
150
|
-
? item[stage.$group._id.substring(1)]
|
|
151
|
-
: stage.$group._id;
|
|
152
|
-
}
|
|
153
|
-
else if (typeof stage.$group._id === "object") {
|
|
154
|
-
groupKey = JSON.stringify(Object.entries(stage.$group._id).reduce((acc, [k, v]) => {
|
|
155
|
-
const fieldPath = v.replace("$", "");
|
|
156
|
-
acc[k] = item[fieldPath];
|
|
157
|
-
return acc;
|
|
158
|
-
}, {}));
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
groupKey = "null";
|
|
162
|
-
}
|
|
163
|
-
if (!groupedData[groupKey]) {
|
|
164
|
-
groupedData[groupKey] = { _id: groupKey };
|
|
165
|
-
}
|
|
166
|
-
for (const [key, operation] of Object.entries(stage.$group)) {
|
|
167
|
-
if (key === "_id")
|
|
168
|
-
continue;
|
|
169
|
-
if (operation.$avg !== undefined) {
|
|
170
|
-
const operand = operation.$avg;
|
|
171
|
-
const value = typeof operand === "string" ? item[operand.replace("$", "")] : operand;
|
|
172
|
-
groupedData[groupKey][key] = groupedData[groupKey][key] || {
|
|
173
|
-
sum: 0,
|
|
174
|
-
count: 0,
|
|
175
|
-
};
|
|
176
|
-
groupedData[groupKey][key].sum += value;
|
|
177
|
-
groupedData[groupKey][key].count += 1;
|
|
178
|
-
}
|
|
179
|
-
if (operation.$sum !== undefined) {
|
|
180
|
-
const operand = operation.$sum;
|
|
181
|
-
const value = typeof operand === "string" ? item[operand.replace("$", "")] : operand;
|
|
182
|
-
groupedData[groupKey][key] = (groupedData[groupKey][key] || 0) + value;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
result = Object.values(groupedData).map((group) => {
|
|
187
|
-
for (const key in group) {
|
|
188
|
-
if (group[key] && group[key].sum !== undefined) {
|
|
189
|
-
group[key] = group[key].sum / group[key].count;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return group;
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
if (stage.$sort) {
|
|
196
|
-
const [[key, order]] = Object.entries(stage.$sort);
|
|
197
|
-
const numOrder = Number(order);
|
|
198
|
-
result.sort((a, b) => {
|
|
199
|
-
if (a[key] < b[key])
|
|
200
|
-
return -numOrder;
|
|
201
|
-
if (a[key] > b[key])
|
|
202
|
-
return numOrder;
|
|
203
|
-
return 0;
|
|
204
|
-
});
|
|
40
|
+
if (!stage || typeof stage !== "object")
|
|
41
|
+
continue;
|
|
42
|
+
const opName = Object.keys(stage)[0];
|
|
43
|
+
if (!opName)
|
|
44
|
+
continue;
|
|
45
|
+
const opExpr = stage[opName];
|
|
46
|
+
if (opName === "$lookup") {
|
|
47
|
+
result = yield (0, stageOperators_1.executeLookup)(result, opExpr, this.collectionResolver);
|
|
48
|
+
continue;
|
|
205
49
|
}
|
|
206
|
-
if (
|
|
207
|
-
result =
|
|
208
|
-
|
|
209
|
-
for (const key in stage.$project) {
|
|
210
|
-
if (stage.$project[key] === 1) {
|
|
211
|
-
projected[key] = item[key];
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return projected;
|
|
215
|
-
});
|
|
50
|
+
if (opName === "$facet") {
|
|
51
|
+
result = [(0, stageOperators_1.executeFacet)(result, opExpr)];
|
|
52
|
+
continue;
|
|
216
53
|
}
|
|
217
|
-
if (
|
|
218
|
-
result =
|
|
54
|
+
if (opName === "$bucket") {
|
|
55
|
+
result = (0, stageOperators_1.executeBucket)(result, opExpr);
|
|
56
|
+
continue;
|
|
219
57
|
}
|
|
220
|
-
if (
|
|
221
|
-
result =
|
|
58
|
+
if (opName === "$bucketAuto") {
|
|
59
|
+
result = (0, stageOperators_1.executeBucketAuto)(result, opExpr);
|
|
60
|
+
continue;
|
|
222
61
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
result = result
|
|
226
|
-
|
|
227
|
-
? item[field].map((value) => (Object.assign(Object.assign({}, item), { [field]: value })))
|
|
228
|
-
: [item];
|
|
229
|
-
});
|
|
62
|
+
const builtInOp = stageOperators_1.BUILT_IN_STAGE_OPERATORS[opName];
|
|
63
|
+
if (builtInOp) {
|
|
64
|
+
result = builtInOp(result, opExpr);
|
|
65
|
+
continue;
|
|
230
66
|
}
|
|
231
|
-
|
|
232
|
-
|
|
67
|
+
const registered = OperatorRegistry_1.OperatorRegistry.getOperator(opName);
|
|
68
|
+
if (registered && registered.type === "stage") {
|
|
69
|
+
const customResult = registered.fn(result, opExpr, this.collectionResolver);
|
|
70
|
+
result = customResult instanceof Promise ? yield customResult : customResult;
|
|
71
|
+
continue;
|
|
233
72
|
}
|
|
73
|
+
Console_helper_1.default.red(`Unknown aggregation stage operator: ${opName}`);
|
|
234
74
|
}
|
|
235
75
|
return this.ResponseHelper.Success(result);
|
|
236
76
|
});
|
|
237
77
|
}
|
|
238
|
-
|
|
239
|
-
* Loads all buffer raw data from the specified directory.
|
|
240
|
-
*
|
|
241
|
-
* This method performs the following steps:
|
|
242
|
-
* 1. Checks if the directory is locked.
|
|
243
|
-
* 2. If the directory is not locked, it lists all files in the directory.
|
|
244
|
-
* 3. Reads each file.
|
|
245
|
-
* 4. Stores the data in the `AllData` array.
|
|
246
|
-
* 5. If the directory is locked, it unlocks the directory, reads the files, and then locks the directory again.
|
|
247
|
-
*
|
|
248
|
-
* @returns {Promise<SuccessInterface | ErrorInterface>} A promise that resolves to a success or error response.
|
|
249
|
-
*
|
|
250
|
-
* @throws {Error} Throws an error if any operation fails.
|
|
251
|
-
*/
|
|
252
|
-
LoadAllBufferRawData(documentIdDirectFile) {
|
|
78
|
+
loadSourceData() {
|
|
253
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
80
|
+
const matchExpr = (0, stageOperators_1.extractMatchFromPipeline)(this.Pipeline);
|
|
81
|
+
if (matchExpr) {
|
|
82
|
+
try {
|
|
83
|
+
const fileNames = yield new ReadIndex_service_1.ReadIndex(this.path).getFileFromIndex(matchExpr);
|
|
84
|
+
if (fileNames.length > 0) {
|
|
85
|
+
const result = yield DocumentLoader_helper_1.default.loadDocuments(this.path, fileNames, false);
|
|
86
|
+
if ("data" in result) {
|
|
87
|
+
this.AllData = result.data;
|
|
88
|
+
Console_helper_1.default.green(`${this.AllData.length} Documents Loaded for Aggregation (index-optimized)`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (_a) {
|
|
94
|
+
// Index miss - fall through to full scan
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const result = yield DocumentLoader_helper_1.default.loadDocuments(this.path, undefined, false);
|
|
258
98
|
if ("data" in result) {
|
|
259
99
|
this.AllData = result.data;
|
|
100
|
+
Console_helper_1.default.green(`${this.AllData.length} Documents Loaded for Aggregation`);
|
|
260
101
|
}
|
|
261
|
-
return result;
|
|
262
102
|
});
|
|
263
103
|
}
|
|
264
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Aggregation.Operation.js","sourceRoot":"","sources":["../../../source/Services/Aggregation/Aggregation.Operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mFAA0D;AAK1D,+FAAgE;AAChE,iFAAkD;AAClD,kEAAuD;
|
|
1
|
+
{"version":3,"file":"Aggregation.Operation.js","sourceRoot":"","sources":["../../../source/Services/Aggregation/Aggregation.Operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,mFAA0D;AAK1D,+FAAgE;AAChE,iFAAkD;AAClD,kEAAuD;AAEvD,yDAAsD;AACtD,+DAOoC;AAEpC;IAQE,YACE,cAAsB,EACtB,IAAY,EACZ,QAAwB,EACxB,kBAAuC;QAXjC,YAAO,GAAU,EAAE,CAAC;QAa1B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,IAAI,yBAAc,EAAE,CAAC;QAC3C,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAEY,IAAI;;YACf,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YAED,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAE5B,IAAI,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;YAE/B,KAAK,MAAM,KAAK,IAAI,IAAI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AAG,MAAM,CAAC,IAAI,CAAC;gBAC3B,wBAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAmC,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StageOperatorFn, AccumulatorFn, ExpressionFn, RegisteredOperator } from "../../config/Interfaces/Operation/aggregation.interface";
|
|
2
|
+
export declare class OperatorRegistry {
|
|
3
|
+
private static operators;
|
|
4
|
+
static registerStageOperator(name: string, fn: StageOperatorFn): void;
|
|
5
|
+
static registerAccumulator(name: string, fn: AccumulatorFn): void;
|
|
6
|
+
static registerExpressionOperator(name: string, fn: ExpressionFn): void;
|
|
7
|
+
static getOperator(name: string): RegisteredOperator | undefined;
|
|
8
|
+
static getAllByType(type: "stage" | "accumulator" | "expression"): RegisteredOperator[];
|
|
9
|
+
static getRegisteredNames(): string[];
|
|
10
|
+
static clearAll(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperatorRegistry = void 0;
|
|
4
|
+
class OperatorRegistry {
|
|
5
|
+
static registerStageOperator(name, fn) {
|
|
6
|
+
if (!name.startsWith("$"))
|
|
7
|
+
throw new Error(`Operator name must start with "$", got: "${name}"`);
|
|
8
|
+
OperatorRegistry.operators.set(name, { type: "stage", name, fn });
|
|
9
|
+
}
|
|
10
|
+
static registerAccumulator(name, fn) {
|
|
11
|
+
if (!name.startsWith("$"))
|
|
12
|
+
throw new Error(`Operator name must start with "$", got: "${name}"`);
|
|
13
|
+
OperatorRegistry.operators.set(name, { type: "accumulator", name, fn });
|
|
14
|
+
}
|
|
15
|
+
static registerExpressionOperator(name, fn) {
|
|
16
|
+
if (!name.startsWith("$"))
|
|
17
|
+
throw new Error(`Operator name must start with "$", got: "${name}"`);
|
|
18
|
+
OperatorRegistry.operators.set(name, { type: "expression", name, fn });
|
|
19
|
+
}
|
|
20
|
+
static getOperator(name) {
|
|
21
|
+
return OperatorRegistry.operators.get(name);
|
|
22
|
+
}
|
|
23
|
+
static getAllByType(type) {
|
|
24
|
+
return [...OperatorRegistry.operators.values()].filter(op => op.type === type);
|
|
25
|
+
}
|
|
26
|
+
static getRegisteredNames() {
|
|
27
|
+
return [...OperatorRegistry.operators.keys()];
|
|
28
|
+
}
|
|
29
|
+
static clearAll() {
|
|
30
|
+
OperatorRegistry.operators.clear();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.OperatorRegistry = OperatorRegistry;
|
|
34
|
+
OperatorRegistry.operators = new Map();
|
|
35
|
+
//# sourceMappingURL=OperatorRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperatorRegistry.js","sourceRoot":"","sources":["../../../source/Services/Aggregation/OperatorRegistry.ts"],"names":[],"mappings":";;;AAQA;IAGE,MAAM,CAAC,qBAAqB,CAAC,IAAY,EAAE,EAAmB;QAC5D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,GAAG,CAAC,CAAC;QAChG,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,IAAY,EAAE,EAAiB;QACxD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,GAAG,CAAC,CAAC;QAChG,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,IAAY,EAAE,EAAgB;QAC9D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,GAAG,CAAC,CAAC;QAChG,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,IAAY;QAC7B,OAAO,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,IAA4C;QAC9D,OAAO,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,CAAC,kBAAkB;QACvB,OAAO,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,QAAQ;QACb,gBAAgB,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;CACF;;AAhCgB,0BAAS,GAAoC,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function accumulatorSum(groupDocs: any[], expr: any): number;
|
|
2
|
+
export declare function accumulatorAvg(groupDocs: any[], expr: any): number | null;
|
|
3
|
+
export declare function accumulatorMin(groupDocs: any[], expr: any): any;
|
|
4
|
+
export declare function accumulatorMax(groupDocs: any[], expr: any): any;
|
|
5
|
+
export declare function accumulatorFirst(groupDocs: any[], expr: any): any;
|
|
6
|
+
export declare function accumulatorLast(groupDocs: any[], expr: any): any;
|
|
7
|
+
export declare function accumulatorPush(groupDocs: any[], expr: any): any[];
|
|
8
|
+
export declare function accumulatorAddToSet(groupDocs: any[], expr: any): any[];
|
|
9
|
+
export declare function accumulatorStdDevPop(groupDocs: any[], expr: any): number | null;
|
|
10
|
+
export declare function accumulatorStdDevSamp(groupDocs: any[], expr: any): number | null;
|
|
11
|
+
export declare function accumulatorCount(groupDocs: any[]): number;
|
|
12
|
+
export declare const BUILT_IN_ACCUMULATORS: Record<string, (groupDocs: any[], expr: any) => any>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUILT_IN_ACCUMULATORS = void 0;
|
|
4
|
+
exports.accumulatorSum = accumulatorSum;
|
|
5
|
+
exports.accumulatorAvg = accumulatorAvg;
|
|
6
|
+
exports.accumulatorMin = accumulatorMin;
|
|
7
|
+
exports.accumulatorMax = accumulatorMax;
|
|
8
|
+
exports.accumulatorFirst = accumulatorFirst;
|
|
9
|
+
exports.accumulatorLast = accumulatorLast;
|
|
10
|
+
exports.accumulatorPush = accumulatorPush;
|
|
11
|
+
exports.accumulatorAddToSet = accumulatorAddToSet;
|
|
12
|
+
exports.accumulatorStdDevPop = accumulatorStdDevPop;
|
|
13
|
+
exports.accumulatorStdDevSamp = accumulatorStdDevSamp;
|
|
14
|
+
exports.accumulatorCount = accumulatorCount;
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
16
|
+
const expressionOperators_1 = require("./expressionOperators");
|
|
17
|
+
function resolveOperand(doc, operand) {
|
|
18
|
+
if (typeof operand === "string" && operand.startsWith("$")) {
|
|
19
|
+
return doc[operand.substring(1)];
|
|
20
|
+
}
|
|
21
|
+
if (typeof operand === "object" && operand !== null) {
|
|
22
|
+
return (0, expressionOperators_1.evaluateExpression)(doc, operand);
|
|
23
|
+
}
|
|
24
|
+
return operand;
|
|
25
|
+
}
|
|
26
|
+
function accumulatorSum(groupDocs, expr) {
|
|
27
|
+
if (typeof expr === "number")
|
|
28
|
+
return groupDocs.length * expr;
|
|
29
|
+
return groupDocs.reduce((sum, doc) => {
|
|
30
|
+
const val = resolveOperand(doc, expr);
|
|
31
|
+
return sum + (typeof val === "number" ? val : 0);
|
|
32
|
+
}, 0);
|
|
33
|
+
}
|
|
34
|
+
function accumulatorAvg(groupDocs, expr) {
|
|
35
|
+
if (groupDocs.length === 0)
|
|
36
|
+
return null;
|
|
37
|
+
let sum = 0;
|
|
38
|
+
let count = 0;
|
|
39
|
+
for (const doc of groupDocs) {
|
|
40
|
+
const val = resolveOperand(doc, expr);
|
|
41
|
+
if (typeof val === "number" && !isNaN(val)) {
|
|
42
|
+
sum += val;
|
|
43
|
+
count++;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return count > 0 ? sum / count : null;
|
|
47
|
+
}
|
|
48
|
+
function accumulatorMin(groupDocs, expr) {
|
|
49
|
+
if (groupDocs.length === 0)
|
|
50
|
+
return null;
|
|
51
|
+
let min = undefined;
|
|
52
|
+
for (const doc of groupDocs) {
|
|
53
|
+
const val = resolveOperand(doc, expr);
|
|
54
|
+
if (val !== null && val !== undefined && (min === undefined || val < min)) {
|
|
55
|
+
min = val;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return min !== undefined ? min : null;
|
|
59
|
+
}
|
|
60
|
+
function accumulatorMax(groupDocs, expr) {
|
|
61
|
+
if (groupDocs.length === 0)
|
|
62
|
+
return null;
|
|
63
|
+
let max = undefined;
|
|
64
|
+
for (const doc of groupDocs) {
|
|
65
|
+
const val = resolveOperand(doc, expr);
|
|
66
|
+
if (val !== null && val !== undefined && (max === undefined || val > max)) {
|
|
67
|
+
max = val;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return max !== undefined ? max : null;
|
|
71
|
+
}
|
|
72
|
+
function accumulatorFirst(groupDocs, expr) {
|
|
73
|
+
if (groupDocs.length === 0)
|
|
74
|
+
return null;
|
|
75
|
+
return resolveOperand(groupDocs[0], expr);
|
|
76
|
+
}
|
|
77
|
+
function accumulatorLast(groupDocs, expr) {
|
|
78
|
+
if (groupDocs.length === 0)
|
|
79
|
+
return null;
|
|
80
|
+
return resolveOperand(groupDocs[groupDocs.length - 1], expr);
|
|
81
|
+
}
|
|
82
|
+
function accumulatorPush(groupDocs, expr) {
|
|
83
|
+
return groupDocs.map(doc => resolveOperand(doc, expr));
|
|
84
|
+
}
|
|
85
|
+
function accumulatorAddToSet(groupDocs, expr) {
|
|
86
|
+
const seen = new Set();
|
|
87
|
+
const result = [];
|
|
88
|
+
for (const doc of groupDocs) {
|
|
89
|
+
const val = resolveOperand(doc, expr);
|
|
90
|
+
const key = JSON.stringify(val);
|
|
91
|
+
if (!seen.has(key)) {
|
|
92
|
+
seen.add(key);
|
|
93
|
+
result.push(val);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
function accumulatorStdDevPop(groupDocs, expr) {
|
|
99
|
+
if (groupDocs.length === 0)
|
|
100
|
+
return null;
|
|
101
|
+
const values = groupDocs
|
|
102
|
+
.map(doc => resolveOperand(doc, expr))
|
|
103
|
+
.filter(v => typeof v === "number" && !isNaN(v));
|
|
104
|
+
if (values.length === 0)
|
|
105
|
+
return null;
|
|
106
|
+
const mean = values.reduce((a, b) => a + b, 0) / values.length;
|
|
107
|
+
const variance = values.reduce((sum, v) => sum + Math.pow(v - mean, 2), 0) / values.length;
|
|
108
|
+
return Math.sqrt(variance);
|
|
109
|
+
}
|
|
110
|
+
function accumulatorStdDevSamp(groupDocs, expr) {
|
|
111
|
+
if (groupDocs.length <= 1)
|
|
112
|
+
return null;
|
|
113
|
+
const values = groupDocs
|
|
114
|
+
.map(doc => resolveOperand(doc, expr))
|
|
115
|
+
.filter(v => typeof v === "number" && !isNaN(v));
|
|
116
|
+
if (values.length <= 1)
|
|
117
|
+
return null;
|
|
118
|
+
const mean = values.reduce((a, b) => a + b, 0) / values.length;
|
|
119
|
+
const variance = values.reduce((sum, v) => sum + Math.pow(v - mean, 2), 0) / (values.length - 1);
|
|
120
|
+
return Math.sqrt(variance);
|
|
121
|
+
}
|
|
122
|
+
function accumulatorCount(groupDocs) {
|
|
123
|
+
return groupDocs.length;
|
|
124
|
+
}
|
|
125
|
+
exports.BUILT_IN_ACCUMULATORS = {
|
|
126
|
+
$sum: accumulatorSum,
|
|
127
|
+
$avg: accumulatorAvg,
|
|
128
|
+
$min: accumulatorMin,
|
|
129
|
+
$max: accumulatorMax,
|
|
130
|
+
$first: accumulatorFirst,
|
|
131
|
+
$last: accumulatorLast,
|
|
132
|
+
$push: accumulatorPush,
|
|
133
|
+
$addToSet: accumulatorAddToSet,
|
|
134
|
+
$stdDevPop: accumulatorStdDevPop,
|
|
135
|
+
$stdDevSamp: accumulatorStdDevSamp,
|
|
136
|
+
$count: accumulatorCount,
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=accumulatorOperators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accumulatorOperators.js","sourceRoot":"","sources":["../../../../source/Services/Aggregation/operators/accumulatorOperators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,+DAA2D;AAE3D,SAAS,cAAc,CAAC,GAAQ,EAAE,OAAY;IAC5C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACpD,OAAO,IAAA,wCAAkB,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,wBAA+B,SAAgB,EAAE,IAAS;IACxD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC,MAAM,GAAG,IAAI,C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