ballyalley-o / tccp-server

A scalable backend server solution designed to manage and orchestrate software development bootcamps/courses from multiple schools, providing robust APIs and data storage capabilities.
2 stars 0 forks source link

[BUG] : Parameter "filter" to findOneAndUpdate() must be an object #56

Closed ballyalley-o closed 5 months ago

ballyalley-o commented 5 months ago

Describe the bug

/Users/bally/workspace/tccp-server/node_modules/mongoose/lib/query.js:3199 [run] new ObjectParameterError(filter, 'filter', 'findOneAndUpdate') [run] ^ [run] [run] ObjectParameterError: Parameter "filter" to findOneAndUpdate() must be an object, got "66228f3d8d49c2652efe12cf" (type string) [run] at Query.findOneAndUpdate (/Users/bally/workspace/tccp-server/node_modules/mongoose/lib/query.js:3199:7) [run] at Model.findOneAndUpdate (/Users/bally/workspace/tccp-server/node_modules/mongoose/lib/model.js:2538:13) [run] at updateBootcamp (file:///Users/bally/workspace/tccp-server/dist/controller/bootcamp.js:87:35) [run] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [run]

To Reproduce Steps to reproduce the behavior:

  1. Go to 'bootcamp'
  2. Update a bootcamp
  3. See error in the console

Expected behavior A response with the updated entity should be sent

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.