c2-mongoose 2.1.47 → 2.1.48

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.
@@ -15,7 +15,7 @@ declare class CrudFlow<D> {
15
15
  update(id: string, data: D, session?: any): Promise<D>;
16
16
  updateAny(id: string, data: any, session?: any): Promise<D>;
17
17
  updateByModel(filter: any, data: any, params: any): Promise<D>;
18
- find(...pipelineStages: PipelineStage[]): Promise<SearchResponse<D>>;
18
+ find(pipelineStages?: PipelineStage[]): Promise<SearchResponse<D>>;
19
19
  getOne(model: D, params?: any): Promise<D>;
20
20
  get(id: string, pop?: string, sel?: string, session?: ClientSession): Promise<D>;
21
21
  getById(id: string, session?: ClientSession): Promise<Partial<D>>;
@@ -123,11 +123,7 @@ var CrudFlow = /** @class */ (function () {
123
123
  });
124
124
  });
125
125
  };
126
- CrudFlow.prototype.find = function () {
127
- var pipelineStages = [];
128
- for (var _i = 0; _i < arguments.length; _i++) {
129
- pipelineStages[_i] = arguments[_i];
130
- }
126
+ CrudFlow.prototype.find = function (pipelineStages) {
131
127
  return __awaiter(this, void 0, void 0, function () {
132
128
  return __generator(this, function (_a) {
133
129
  switch (_a.label) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.47",
3
+ "version": "2.1.48",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,7 +47,7 @@ class CrudFlow<D> {
47
47
  return dataAfter as D
48
48
  }
49
49
 
50
- public async find(...pipelineStages: PipelineStage[]): Promise<SearchResponse<D>> {
50
+ public async find(pipelineStages?: PipelineStage[]): Promise<SearchResponse<D>> {
51
51
  return await this.search.search(this.repository, pipelineStages)
52
52
  }
53
53