axiodb 1.4.2 → 1.4.3
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/lib/Operation/Aggregation/Aggregation.Operation.d.ts +57 -0
- package/lib/Operation/Aggregation/Aggregation.Operation.js +304 -0
- package/lib/Operation/Aggregation/Aggregation.Operation.js.map +1 -0
- package/lib/Operation/Collection/collection.operation.d.ts +14 -1
- package/lib/Operation/Collection/collection.operation.js +20 -1
- package/lib/Operation/Collection/collection.operation.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
* The class can handle both encrypted and non-encrypted data collections.
|
|
10
|
+
*/
|
|
11
|
+
export default class Aggregation {
|
|
12
|
+
private AllData;
|
|
13
|
+
private readonly Pipeline;
|
|
14
|
+
private path;
|
|
15
|
+
private readonly collectionName;
|
|
16
|
+
private readonly ResponseHelper;
|
|
17
|
+
private isEncrypted;
|
|
18
|
+
private encryptionKey?;
|
|
19
|
+
private cryptoInstance?;
|
|
20
|
+
private readonly Converter;
|
|
21
|
+
constructor(collectionName: string, path: string, Pipeline: object[] | any, isEncrypted?: boolean, encryptionKey?: string);
|
|
22
|
+
/**
|
|
23
|
+
* Executes the aggregation pipeline on the data.
|
|
24
|
+
*
|
|
25
|
+
* This method processes the aggregation pipeline stages in sequence:
|
|
26
|
+
* - $match: Filters documents based on specified conditions
|
|
27
|
+
* - $group: Groups documents by specified fields and applies aggregation operations
|
|
28
|
+
* - $sort: Sorts documents based on specified fields and order
|
|
29
|
+
* - $project: Reshapes documents by including specified fields
|
|
30
|
+
* - $limit: Limits the number of documents in the result
|
|
31
|
+
* - $skip: Skips a specified number of documents
|
|
32
|
+
* - $unwind: Deconstructs an array field from input documents
|
|
33
|
+
* - $addFields: Adds new fields to documents
|
|
34
|
+
*
|
|
35
|
+
* The method first validates if the pipeline is an array, loads all buffer data,
|
|
36
|
+
* and then processes each stage of the pipeline sequentially.
|
|
37
|
+
*
|
|
38
|
+
* @throws {Error} If the pipeline is not an array
|
|
39
|
+
* @returns {Array<any>} The result of the aggregation pipeline
|
|
40
|
+
*/
|
|
41
|
+
exec(): Promise<SuccessInterface | ErrorInterface>;
|
|
42
|
+
/**
|
|
43
|
+
* Loads all buffer raw data from the specified directory.
|
|
44
|
+
*
|
|
45
|
+
* This method performs the following steps:
|
|
46
|
+
* 1. Checks if the directory is locked.
|
|
47
|
+
* 2. If the directory is not locked, it lists all files in the directory.
|
|
48
|
+
* 3. Reads each file and decrypts the data if encryption is enabled.
|
|
49
|
+
* 4. Stores the decrypted data in the `AllData` array.
|
|
50
|
+
* 5. If the directory is locked, it unlocks the directory, reads the files, and then locks the directory again.
|
|
51
|
+
*
|
|
52
|
+
* @returns {Promise<SuccessInterface | ErrorInterface>} A promise that resolves to a success or error response.
|
|
53
|
+
*
|
|
54
|
+
* @throws {Error} Throws an error if any operation fails.
|
|
55
|
+
*/
|
|
56
|
+
private LoadAllBufferRawData;
|
|
57
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const response_helper_1 = __importDefault(require("../../Helper/response.helper"));
|
|
16
|
+
const Crypto_helper_1 = require("../../Helper/Crypto.helper");
|
|
17
|
+
const FolderManager_1 = __importDefault(require("../../Storage/FolderManager"));
|
|
18
|
+
const FileManager_1 = __importDefault(require("../../Storage/FileManager"));
|
|
19
|
+
const Converter_helper_1 = __importDefault(require("../../Helper/Converter.helper"));
|
|
20
|
+
/**
|
|
21
|
+
* Class that performs aggregation operations on data.
|
|
22
|
+
*
|
|
23
|
+
* This class allows for MongoDB-like aggregation pipeline operations on collection data.
|
|
24
|
+
* It supports various stages including $match, $group, $sort, $project, $limit, $skip,
|
|
25
|
+
* $unwind, and $addFields.
|
|
26
|
+
*
|
|
27
|
+
* The class can handle both encrypted and non-encrypted data collections.
|
|
28
|
+
*/
|
|
29
|
+
class Aggregation {
|
|
30
|
+
constructor(collectionName, path, Pipeline, isEncrypted = false, encryptionKey) {
|
|
31
|
+
// property to store the data
|
|
32
|
+
this.AllData = [];
|
|
33
|
+
this.collectionName = collectionName;
|
|
34
|
+
this.path = path;
|
|
35
|
+
this.isEncrypted = isEncrypted;
|
|
36
|
+
this.encryptionKey = encryptionKey;
|
|
37
|
+
this.AllData = [];
|
|
38
|
+
this.Pipeline = Pipeline;
|
|
39
|
+
this.ResponseHelper = new response_helper_1.default();
|
|
40
|
+
this.Converter = new Converter_helper_1.default();
|
|
41
|
+
this.cryptoInstance = new Crypto_helper_1.CryptoHelper(this.encryptionKey);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Executes the aggregation pipeline on the data.
|
|
45
|
+
*
|
|
46
|
+
* This method processes the aggregation pipeline stages in sequence:
|
|
47
|
+
* - $match: Filters documents based on specified conditions
|
|
48
|
+
* - $group: Groups documents by specified fields and applies aggregation operations
|
|
49
|
+
* - $sort: Sorts documents based on specified fields and order
|
|
50
|
+
* - $project: Reshapes documents by including specified fields
|
|
51
|
+
* - $limit: Limits the number of documents in the result
|
|
52
|
+
* - $skip: Skips a specified number of documents
|
|
53
|
+
* - $unwind: Deconstructs an array field from input documents
|
|
54
|
+
* - $addFields: Adds new fields to documents
|
|
55
|
+
*
|
|
56
|
+
* The method first validates if the pipeline is an array, loads all buffer data,
|
|
57
|
+
* and then processes each stage of the pipeline sequentially.
|
|
58
|
+
*
|
|
59
|
+
* @throws {Error} If the pipeline is not an array
|
|
60
|
+
* @returns {Array<any>} The result of the aggregation pipeline
|
|
61
|
+
*/
|
|
62
|
+
exec() {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
if (!Array.isArray(this.Pipeline)) {
|
|
65
|
+
throw new Error("Pipeline must be an array of aggregation stages.");
|
|
66
|
+
}
|
|
67
|
+
// Load all buffer raw data from the specified directory
|
|
68
|
+
yield this.LoadAllBufferRawData().then((response) => {
|
|
69
|
+
if ("data" in response) {
|
|
70
|
+
console.log("Data Loaded Successfully for Aggregation");
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
let result = [...this.AllData];
|
|
74
|
+
for (const stage of this.Pipeline) {
|
|
75
|
+
if (stage.$match) {
|
|
76
|
+
result = result.filter((item) => {
|
|
77
|
+
return Object.entries(stage.$match).every(([key, value]) => {
|
|
78
|
+
var _a;
|
|
79
|
+
const itemValue = (_a = item[key]) !== null && _a !== void 0 ? _a : ""; // Ensure item[key] exists
|
|
80
|
+
if (typeof value === "string" ||
|
|
81
|
+
typeof value === "number" ||
|
|
82
|
+
typeof value === "boolean") {
|
|
83
|
+
return itemValue === value;
|
|
84
|
+
}
|
|
85
|
+
if (typeof value === "object" && value !== null) {
|
|
86
|
+
if (value instanceof RegExp) {
|
|
87
|
+
return value.test(itemValue);
|
|
88
|
+
}
|
|
89
|
+
if ("$regex" in value) {
|
|
90
|
+
const regexPattern = value.$regex;
|
|
91
|
+
const regexOptions = "$options" in value ? value.$options : "";
|
|
92
|
+
try {
|
|
93
|
+
const regex = new RegExp(String(regexPattern), regexOptions);
|
|
94
|
+
return regex.test(itemValue);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error(`Invalid regex: ${regexPattern} with options: ${regexOptions}`, error);
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (stage.$group) {
|
|
107
|
+
const groupedData = {};
|
|
108
|
+
for (const item of result) {
|
|
109
|
+
let groupKey;
|
|
110
|
+
if (typeof stage.$group._id === "string") {
|
|
111
|
+
groupKey = stage.$group._id.startsWith("$")
|
|
112
|
+
? item[stage.$group._id.substring(1)]
|
|
113
|
+
: stage.$group._id;
|
|
114
|
+
}
|
|
115
|
+
else if (typeof stage.$group._id === "object") {
|
|
116
|
+
groupKey = JSON.stringify(Object.entries(stage.$group._id).reduce((acc, [k, v]) => {
|
|
117
|
+
const fieldPath = v.replace("$", "");
|
|
118
|
+
acc[k] = item[fieldPath];
|
|
119
|
+
return acc;
|
|
120
|
+
}, {}));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
groupKey = "null";
|
|
124
|
+
}
|
|
125
|
+
if (!groupedData[groupKey]) {
|
|
126
|
+
groupedData[groupKey] = { _id: groupKey };
|
|
127
|
+
}
|
|
128
|
+
for (const [key, operation] of Object.entries(stage.$group)) {
|
|
129
|
+
if (key === "_id")
|
|
130
|
+
continue;
|
|
131
|
+
if (operation.$avg) {
|
|
132
|
+
const field = operation.$avg.replace("$", "");
|
|
133
|
+
groupedData[groupKey][key] = groupedData[groupKey][key] || {
|
|
134
|
+
sum: 0,
|
|
135
|
+
count: 0,
|
|
136
|
+
};
|
|
137
|
+
groupedData[groupKey][key].sum += item[field];
|
|
138
|
+
groupedData[groupKey][key].count += 1;
|
|
139
|
+
}
|
|
140
|
+
if (operation.$sum) {
|
|
141
|
+
const field = operation.$sum.replace("$", "");
|
|
142
|
+
groupedData[groupKey][key] =
|
|
143
|
+
(groupedData[groupKey][key] || 0) + item[field];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
result = Object.values(groupedData).map((group) => {
|
|
148
|
+
for (const key in group) {
|
|
149
|
+
if (group[key] && group[key].sum !== undefined) {
|
|
150
|
+
group[key] = group[key].sum / group[key].count;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return group;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (stage.$sort) {
|
|
157
|
+
const [[key, order]] = Object.entries(stage.$sort);
|
|
158
|
+
const numOrder = Number(order);
|
|
159
|
+
result.sort((a, b) => {
|
|
160
|
+
if (a[key] < b[key])
|
|
161
|
+
return -numOrder;
|
|
162
|
+
if (a[key] > b[key])
|
|
163
|
+
return numOrder;
|
|
164
|
+
return 0;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
if (stage.$project) {
|
|
168
|
+
result = result.map((item) => {
|
|
169
|
+
const projected = {};
|
|
170
|
+
for (const key in stage.$project) {
|
|
171
|
+
if (stage.$project[key] === 1) {
|
|
172
|
+
projected[key] = item[key];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return projected;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (stage.$limit) {
|
|
179
|
+
result = result.slice(0, stage.$limit);
|
|
180
|
+
}
|
|
181
|
+
if (stage.$skip) {
|
|
182
|
+
result = result.slice(stage.$skip);
|
|
183
|
+
}
|
|
184
|
+
if (stage.$unwind) {
|
|
185
|
+
const field = stage.$unwind.replace("$", "");
|
|
186
|
+
result = result.flatMap((item) => {
|
|
187
|
+
return Array.isArray(item[field])
|
|
188
|
+
? item[field].map((value) => (Object.assign(Object.assign({}, item), { [field]: value })))
|
|
189
|
+
: [item];
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (stage.$addFields) {
|
|
193
|
+
result = result.map((item) => (Object.assign(Object.assign({}, item), stage.$addFields)));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return this.ResponseHelper.Success(result);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Loads all buffer raw data from the specified directory.
|
|
201
|
+
*
|
|
202
|
+
* This method performs the following steps:
|
|
203
|
+
* 1. Checks if the directory is locked.
|
|
204
|
+
* 2. If the directory is not locked, it lists all files in the directory.
|
|
205
|
+
* 3. Reads each file and decrypts the data if encryption is enabled.
|
|
206
|
+
* 4. Stores the decrypted data in the `AllData` array.
|
|
207
|
+
* 5. If the directory is locked, it unlocks the directory, reads the files, and then locks the directory again.
|
|
208
|
+
*
|
|
209
|
+
* @returns {Promise<SuccessInterface | ErrorInterface>} A promise that resolves to a success or error response.
|
|
210
|
+
*
|
|
211
|
+
* @throws {Error} Throws an error if any operation fails.
|
|
212
|
+
*/
|
|
213
|
+
LoadAllBufferRawData() {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
try {
|
|
216
|
+
// Check if Directory Locked or not
|
|
217
|
+
const isLocked = yield new FolderManager_1.default().IsDirectoryLocked(this.path);
|
|
218
|
+
if ("data" in isLocked) {
|
|
219
|
+
// If Directory is not locked
|
|
220
|
+
if (isLocked.data === false) {
|
|
221
|
+
// Read List the data from the file
|
|
222
|
+
const ReadResponse = yield new FolderManager_1.default().ListDirectory(this.path);
|
|
223
|
+
if ("data" in ReadResponse) {
|
|
224
|
+
// Store all files in DataFilesList
|
|
225
|
+
const DataFilesList = ReadResponse.data;
|
|
226
|
+
// Read all files from the directory
|
|
227
|
+
for (let i = 0; i < DataFilesList.length; i++) {
|
|
228
|
+
const ReadFileResponse = yield new FileManager_1.default().ReadFile(`${this.path}/${DataFilesList[i]}`);
|
|
229
|
+
// Check if the file is read successfully or not
|
|
230
|
+
if ("data" in ReadFileResponse) {
|
|
231
|
+
if (this.isEncrypted === true && this.cryptoInstance) {
|
|
232
|
+
// Decrypt the data if crypto is enabled
|
|
233
|
+
const ContentResponse = yield this.cryptoInstance.decrypt(this.Converter.ToObject(ReadFileResponse.data));
|
|
234
|
+
// Store all Decrypted Data in AllData
|
|
235
|
+
this.AllData.push(this.Converter.ToObject(ContentResponse));
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
this.AllData.push(this.Converter.ToObject(ReadFileResponse.data));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
return this.ResponseHelper.Error(`Failed to read file: ${DataFilesList[i]}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return this.ResponseHelper.Success(this.AllData);
|
|
246
|
+
}
|
|
247
|
+
return this.ResponseHelper.Error("Failed to read directory");
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
// if Directory is locked then unlock it
|
|
251
|
+
const unlockResponse = yield new FolderManager_1.default().UnlockDirectory(this.path);
|
|
252
|
+
if ("data" in unlockResponse) {
|
|
253
|
+
// Read List the data from the file
|
|
254
|
+
const ReadResponse = yield new FolderManager_1.default().ListDirectory(this.path);
|
|
255
|
+
if ("data" in ReadResponse) {
|
|
256
|
+
// Store all files in DataFilesList
|
|
257
|
+
const DataFilesList = ReadResponse.data;
|
|
258
|
+
// Read all files from the directory
|
|
259
|
+
for (let i = 0; i < DataFilesList.length; i++) {
|
|
260
|
+
const ReadFileResponse = yield new FileManager_1.default().ReadFile(`${this.path}/${DataFilesList[i]}`);
|
|
261
|
+
// Check if the file is read successfully or not
|
|
262
|
+
if ("data" in ReadFileResponse) {
|
|
263
|
+
if (this.isEncrypted === true && this.cryptoInstance) {
|
|
264
|
+
// Decrypt the data if crypto is enabled
|
|
265
|
+
const ContaentResponse = yield this.cryptoInstance.decrypt(this.Converter.ToObject(ReadFileResponse.data));
|
|
266
|
+
// Store all Decrypted Data in AllData
|
|
267
|
+
this.AllData.push(this.Converter.ToObject(ContaentResponse));
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
this.AllData.push(this.Converter.ToObject(ReadFileResponse.data));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
return this.ResponseHelper.Error(`Failed to read file: ${DataFilesList[i]}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// Lock the directory after reading all files
|
|
278
|
+
const lockResponse = yield new FolderManager_1.default().LockDirectory(this.path);
|
|
279
|
+
if ("data" in lockResponse) {
|
|
280
|
+
return this.ResponseHelper.Success(this.AllData);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return this.ResponseHelper.Error(`Failed to lock directory: ${this.path}`);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return this.ResponseHelper.Error(`Failed to read directory: ${this.path}`);
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return this.ResponseHelper.Error(`Failed to unlock directory: ${this.path}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
return this.ResponseHelper.Error(isLocked);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
return this.ResponseHelper.Error(error);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
exports.default = Aggregation;
|
|
304
|
+
//# sourceMappingURL=Aggregation.Operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Aggregation.Operation.js","sourceRoot":"","sources":["../../../source/Operation/Aggregation/Aggregation.Operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mFAA0D;AAC1D,8DAA0D;AAK1D,gFAAwD;AACxD,4EA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CAAC;YAC1C,CAAC;QACH,CAAC;KAAA;CACF;AAxUD,8BAwUC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ErrorInterface, SuccessInterface } from "../../config/Interfaces/Helper/response.helper.interface";
|
|
2
2
|
import Reader from "../CRUD Operation/Reader.operation";
|
|
3
3
|
import DeleteOperation from "../CRUD Operation/Delete.operation";
|
|
4
|
-
import { CryptoHelper } from "../../Helper/Crypto.helper";
|
|
5
4
|
import UpdateOperation from "../CRUD Operation/Update.operation";
|
|
5
|
+
import Aggregation from "../Aggregation/Aggregation.Operation";
|
|
6
|
+
import { CryptoHelper } from "../../Helper/Crypto.helper";
|
|
6
7
|
/**
|
|
7
8
|
* Represents a collection inside a database.
|
|
8
9
|
*/
|
|
@@ -29,6 +30,18 @@ export default class Collection {
|
|
|
29
30
|
* @returns {Reader} - An instance of the Reader class.
|
|
30
31
|
*/
|
|
31
32
|
query(query: object | any): Reader;
|
|
33
|
+
/**
|
|
34
|
+
* Initiates an aggregation operation on the collection with the provided pipeline steps.
|
|
35
|
+
* @param {object[]} PipelineQuerySteps - The pipeline steps to be executed.
|
|
36
|
+
* @returns {Aggregation} - An instance of the Aggregation class.
|
|
37
|
+
* @throws {Error} Throws an error if the pipeline steps are empty.
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Aggregate the collection to get the total count of documents
|
|
41
|
+
* collection.aggregate([{$match: {}}, ${group: {_id: null, count: {$sum: 1}}}]).exec();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
aggregate(PipelineQuerySteps: object[]): Aggregation;
|
|
32
45
|
/**
|
|
33
46
|
* Initiates a delete operation on the collection with the provided query.
|
|
34
47
|
*
|
|
@@ -16,13 +16,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
const Create_operation_1 = __importDefault(require("../CRUD Operation/Create.operation"));
|
|
17
17
|
const Reader_operation_1 = __importDefault(require("../CRUD Operation/Reader.operation"));
|
|
18
18
|
const Delete_operation_1 = __importDefault(require("../CRUD Operation/Delete.operation"));
|
|
19
|
+
const Update_operation_1 = __importDefault(require("../CRUD Operation/Update.operation"));
|
|
20
|
+
const Aggregation_Operation_1 = __importDefault(require("../Aggregation/Aggregation.Operation"));
|
|
19
21
|
const outers_1 = require("outers");
|
|
20
22
|
// Validator
|
|
21
23
|
const validator_models_1 = __importDefault(require("../../Models/validator.models"));
|
|
22
24
|
// Converter
|
|
23
25
|
const Converter_helper_1 = __importDefault(require("../../Helper/Converter.helper"));
|
|
24
26
|
const DataTypes_models_1 = require("../../Models/DataTypes.models");
|
|
25
|
-
const Update_operation_1 = __importDefault(require("../CRUD Operation/Update.operation"));
|
|
26
27
|
/**
|
|
27
28
|
* Represents a collection inside a database.
|
|
28
29
|
*/
|
|
@@ -84,6 +85,24 @@ class Collection {
|
|
|
84
85
|
// Read the data
|
|
85
86
|
return new Reader_operation_1.default(this.name, this.path, query, this.isEncrypted, this.encryptionKey);
|
|
86
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Initiates an aggregation operation on the collection with the provided pipeline steps.
|
|
90
|
+
* @param {object[]} PipelineQuerySteps - The pipeline steps to be executed.
|
|
91
|
+
* @returns {Aggregation} - An instance of the Aggregation class.
|
|
92
|
+
* @throws {Error} Throws an error if the pipeline steps are empty.
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* // Aggregate the collection to get the total count of documents
|
|
96
|
+
* collection.aggregate([{$match: {}}, ${group: {_id: null, count: {$sum: 1}}}]).exec();
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
aggregate(PipelineQuerySteps) {
|
|
100
|
+
// Check if Pipeline Steps is valid Array of Object
|
|
101
|
+
if (!PipelineQuerySteps) {
|
|
102
|
+
throw new Error("Please provide valid Pipeline Steps");
|
|
103
|
+
}
|
|
104
|
+
return new Aggregation_Operation_1.default(this.name, this.path, PipelineQuerySteps, this.isEncrypted, this.encryptionKey);
|
|
105
|
+
}
|
|
87
106
|
/**
|
|
88
107
|
* Initiates a delete operation on the collection with the provided query.
|
|
89
108
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.operation.js","sourceRoot":"","sources":["../../../source/Operation/Collection/collection.operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKA,aAAa;AACb,0FAA2D;AAC3D,0FAAwD;AACxD,0FAAiE;
|
|
1
|
+
{"version":3,"file":"collection.operation.js","sourceRoot":"","sources":["../../../source/Operation/Collection/collection.operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKA,aAAa;AACb,0FAA2D;AAC3D,0FAAwD;AACxD,0FAAiE;AACjE,0FAAiE;AACjE,iGAA+D;AAE/D,mCAAiC;AACjC,YAAY;AACZ,qFAA4D;AAG5D,YAAY;AACZ,qFAAsD;AACtD,oEAA4D;AAE5D;;GAEG;AACH,MAAqB,UAAU;IAW7B,YACE,IAAY,EACZ,IAAY,EACZ,KAAmB,EACnB,WAAW,GAAG,KAAK,EACnB,cAA6B,EAC7B,aAAsB;QAEtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,0BAAS,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,iCAAiC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,0BAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACU,MAAM,CACjB,IAAkB;;YAElB,gCAAgC;YAChC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ACT,KAAK,EACL,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACI,SAAS,CAAC,kBAA4B;QAC3C,mDAAmD;QACnD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,IAAI,+BAAW,CACpB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,EACT,kBAAkB,EAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,KAAmB;QAC/B,sCAAsC;QACtC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QACD,kBAAkB;QAClB,OAAO,IAAI,0BAAe,CACxB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,EACT,KAAK,EACL,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,KAAmB;QAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,IAAI,0BAAe,CACxB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,EACT,KAAK,EACL,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;CACF;AA7JD,6BA6JC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axiodb",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "A fast, lightweight, and scalable open-source DBMS for modern apps. Supports JSON-based data storage, simple APIs, and secure data management. Ideal for projects needing efficient and flexible database solutions.",
|
|
5
5
|
"main": "./lib/config/DB.js",
|
|
6
6
|
"types": "./lib/config/DB.d.ts",
|