Skip to content

Commit bd1cd2e

Browse files
committed
fix: clean where and pipeline when consumed in MongoDriver
1 parent 8a84300 commit bd1cd2e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@secjs/database",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Handle your application database with factories, seeders and query builder in Node.js",
55
"license": "MIT",
66
"author": "João Lenon <lenon@secjs.com.br>",

src/Drivers/MongoDriver.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
Connection,
1414
isValidObjectId,
1515
} from 'mongoose'
16-
import { ObjectID } from 'bson'
16+
import { ObjectID } from 'mongodb'
1717
import { Transaction } from '../Utils/Transaction'
1818
import { DriverFactory } from '../Utils/DriverFactory'
1919
import { InternalServerException } from '@secjs/exceptions'
@@ -69,6 +69,7 @@ export class MongoDriver implements DriverContract {
6969
const where = { ...this._where }
7070

7171
this._where = {}
72+
this._pipeline = []
7273

7374
return where
7475
}
@@ -79,6 +80,7 @@ export class MongoDriver implements DriverContract {
7980
private get pipeline() {
8081
const pipeline = [...this._pipeline]
8182

83+
this._where = {}
8284
this._pipeline = []
8385

8486
return pipeline

0 commit comments

Comments
 (0)