c2-mongoose 2.1.188 → 2.1.190

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.
@@ -62,7 +62,7 @@ var C2Flow = /** @class */ (function () {
62
62
  var dataAfter, log;
63
63
  return __generator(this, function (_a) {
64
64
  switch (_a.label) {
65
- case 0: return [4 /*yield*/, this.repository.create([data], { session: options.session })];
65
+ case 0: return [4 /*yield*/, this.repository.create([data], __assign({}, options))];
66
66
  case 1:
67
67
  dataAfter = _a.sent();
68
68
  if (options.logger === false) {
@@ -102,7 +102,7 @@ var C2Flow = /** @class */ (function () {
102
102
  var dataAfter, log;
103
103
  return __generator(this, function (_a) {
104
104
  switch (_a.label) {
105
- case 0: return [4 /*yield*/, this.repository.findByIdAndUpdate(_id, data, { returnDocument: 'after', session: options.session })];
105
+ case 0: return [4 /*yield*/, this.repository.findByIdAndUpdate(_id, data, __assign({ returnDocument: 'after' }, options))];
106
106
  case 1:
107
107
  dataAfter = _a.sent();
108
108
  if (options.logger === false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.188",
3
+ "version": "2.1.190",
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",
@@ -15,7 +15,7 @@ class C2Flow<D> {
15
15
  }
16
16
 
17
17
  async create(data: Partial<D>, options: Partial<Options>): Promise<Partial<D>> {
18
- let dataAfter = await this.repository.create([data], { session: options.session })
18
+ let dataAfter = await this.repository.create([data], { ...options })
19
19
 
20
20
  if (options.logger === false) {
21
21
  return dataAfter[0]._doc
@@ -41,7 +41,7 @@ class C2Flow<D> {
41
41
  }
42
42
 
43
43
  async updateById(_id: Types.ObjectId, data: Partial<D>, options: Partial<Options>): Promise<Partial<D>> {
44
- let dataAfter = await this.repository.findByIdAndUpdate(_id, data, { returnDocument: 'after', session: options.session })
44
+ let dataAfter = await this.repository.findByIdAndUpdate(_id, data, { returnDocument: 'after', ...options })
45
45
 
46
46
  if (options.logger === false) {
47
47
  if (isEmpty(dataAfter)) {