-
-
Notifications
You must be signed in to change notification settings - Fork 795
Closed
Description
The update method is currently breaking when using data that affects the query.
For example,
const dave = await app.service('people').create({ name: 'Dave' })
// Now mutate AND query the name property.
const result = await app
.service('people')
.update(dave._id, { name: 'Marshal' }, { query: { name: 'Dave' } })The problem originates here:
feathers/packages/mongodb/src/adapter.ts
Line 376 in fe072a2
| return this._findOrGet(id, params).catch(errorHandler) |
We have updated the data, but then this following _findOrGet is using the original query. Because our data mutated a value in that query, the request throws a NotFound (even though the record was updated); This likely needs to be handled similarly to patch/remove.
I am currently working on a mongoJoinQuery for a project that will ultimately end up in feathers-fletching. So I am taking a deep dive in the new Mongo adapter. I will eventually create a PR for this problem and any others I stumble across.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels