c2-mongoose 2.1.211 → 2.1.212

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.
@@ -214,7 +214,7 @@ var SearchFlow = /** @class */ (function () {
214
214
  if (!(_a < _b.length)) return [3 /*break*/, 5];
215
215
  populate = _b[_a];
216
216
  _c = result[0];
217
- return [4 /*yield*/, model.populate(result[0].items, { populate: populate, select: this.projection[populate.path] })];
217
+ return [4 /*yield*/, model.populate(result[0].items, __assign(__assign({}, populate), { select: this.projection ? this.projection[populate.path] : undefined }))];
218
218
  case 3:
219
219
  _c.items = _d.sent();
220
220
  _d.label = 4;
@@ -308,7 +308,7 @@ var SearchFlow = /** @class */ (function () {
308
308
  if (!(_a < _b.length)) return [3 /*break*/, 5];
309
309
  populate = _b[_a];
310
310
  _c = result[0];
311
- return [4 /*yield*/, model.populate(result[0].items, { populate: populate, select: this.projection[populate.path] })];
311
+ return [4 /*yield*/, model.populate(result[0].items, __assign(__assign({}, populate), { select: this.projection ? this.projection[populate.path] : undefined }))];
312
312
  case 3:
313
313
  _c.items = _d.sent();
314
314
  _d.label = 4;
@@ -31,7 +31,6 @@ var BuildSelectSingleFlowItem = /** @class */ (function () {
31
31
  var campoInfo = model.schema.path(first);
32
32
  // Verifique se o tipo do campo é mongoose.Types.ObjectId
33
33
  if (campoInfo.instance === "ObjectID") {
34
- console.log('O campo é um Types.ObjectId');
35
34
  return undefined;
36
35
  }
37
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.211",
3
+ "version": "2.1.212",
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",
@@ -204,7 +204,7 @@ abstract class SearchFlow {
204
204
 
205
205
  if (isNotEmpty(this.populate) && Array.isArray(this.populate)) {
206
206
  for (var populate of this.populate) {
207
- result[0].items = await model.populate(result[0].items, { populate, select: this.projection[populate.path] } as PopulateOptions)
207
+ result[0].items = await model.populate(result[0].items, { ...populate, select: this.projection ? this.projection[populate.path] : undefined } as PopulateOptions)
208
208
  }
209
209
  }
210
210
 
@@ -294,7 +294,7 @@ abstract class SearchFlow {
294
294
 
295
295
  if (isNotEmpty(this.populate) && Array.isArray(this.populate)) {
296
296
  for (var populate of this.populate) {
297
- result[0].items = await model.populate(result[0].items, { populate, select: this.projection[populate.path] } as PopulateOptions)
297
+ result[0].items = await model.populate(result[0].items, { ...populate, select: this.projection ? this.projection[populate.path] : undefined } as PopulateOptions)
298
298
  }
299
299
  }
300
300
 
@@ -27,7 +27,6 @@ class BuildSelectSingleFlowItem {
27
27
 
28
28
  // Verifique se o tipo do campo é mongoose.Types.ObjectId
29
29
  if (campoInfo.instance === "ObjectID") {
30
- console.log('O campo é um Types.ObjectId');
31
30
  return undefined
32
31
  }
33
32
  }