Open sharife3 opened 3 years ago
When running the project and following the steps i came across an issue with findOneAndUpdate in the base-mongo.repository.ts located in the repo-orm lib.
When executing the code it complained with this error:
[Nest] 44633 - [RegisterUserHandler] Object: { "ok": 0, "code": 52, "codeName": "DollarPrefixedFieldName", "name": "MongoError" }
To get this working, i changed the it from { $set: { ...req.updates } } to { ...req.updates }
from:
async findOneAndUpdate(req: UpdateRequest): Promise<DOC> { const collection = await this.collection; const updates = await this.invokeEvents( PRE_KEY, ['UPDATE', 'UPDATE_ONE'], { $set: { ...req.updates } }, );
to:
async findOneAndUpdate(req: UpdateRequest): Promise<DOC> { const collection = await this.collection; const updates = await this.invokeEvents( PRE_KEY, ['UPDATE', 'UPDATE_ONE'], { ...req.updates }, );
Hope this is helpful
When running the project and following the steps i came across an issue with findOneAndUpdate in the base-mongo.repository.ts located in the repo-orm lib.
When executing the code it complained with this error:
To get this working, i changed the it from { $set: { ...req.updates } } to { ...req.updates }
from:
to:
Hope this is helpful