@digipair/skill-mongodb 0.136.1 → 0.136.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/dist/index.cjs.js +10 -0
- package/dist/index.esm.js +64716 -30321
- package/dist/schema.fr.json +71 -0
- package/dist/schema.json +74 -3
- package/package.json +1 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/lib/skill-mongodb.d.ts +0 -14
- package/dist/src/lib/skill-mongodb.d.ts.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -73,6 +73,14 @@ let MongoDBService = class MongoDBService {
|
|
|
73
73
|
await clientInstance.client.close();
|
|
74
74
|
return value;
|
|
75
75
|
}
|
|
76
|
+
async aggregate(params, _pins, context) {
|
|
77
|
+
const { client = context.privates.CLIENT_MONGODB, options = {}, collection, pipeline } = params;
|
|
78
|
+
const clientInstance = await engine.executePinsList(client, context, `${context.__PATH__}.client`);
|
|
79
|
+
const instance = clientInstance.database.collection(collection);
|
|
80
|
+
const values = await instance.aggregate(pipeline, options).toArray();
|
|
81
|
+
await clientInstance.client.close();
|
|
82
|
+
return values;
|
|
83
|
+
}
|
|
76
84
|
};
|
|
77
85
|
const database = (params, pins, context)=>new MongoDBService().database(params, pins, context);
|
|
78
86
|
const find = (params, pins, context)=>new MongoDBService().find(params, pins, context);
|
|
@@ -82,7 +90,9 @@ const insertOne = (params, pins, context)=>new MongoDBService().insertOne(params
|
|
|
82
90
|
const updateOne = (params, pins, context)=>new MongoDBService().updateOne(params, pins, context);
|
|
83
91
|
const updateById = (params, pins, context)=>new MongoDBService().updateById(params, pins, context);
|
|
84
92
|
const count = (params, pins, context)=>new MongoDBService().count(params, pins, context);
|
|
93
|
+
const aggregate = (params, pins, context)=>new MongoDBService().aggregate(params, pins, context);
|
|
85
94
|
|
|
95
|
+
exports.aggregate = aggregate;
|
|
86
96
|
exports.count = count;
|
|
87
97
|
exports.database = database;
|
|
88
98
|
exports.find = find;
|