You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The update method is currently breaking when using data that affects the query.
For example,
constdave=awaitapp.service('people').create({name: 'Dave'})// Now mutate AND query the name property.constresult=awaitapp.service('people').update(dave._id,{name: 'Marshal'},{query: {name: 'Dave'}})
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.
Ah, same problem we had with .patch where it now uses a list of original ids instead. Since update doesn't support multiple updates, should it just remove the query?
I like the query because it throws a NotFound actually. I often use this for some security benefits where I stub on some extra params in the query serverside.
// Serverside hook after auth hookconstpermissionsHook=(context)=>{context.params.query.organizationId=context.params.user.organizationId}
// This will throw a NotFound it item with id: 1 is not in my organizationconstitem=awaitapp.service('items').get(1)
Activity
DaddyWarbucks commentedon Dec 1, 2023
Furthermore, this should probably be a test in the common adapters test suite.
daffl commentedon Dec 1, 2023
Ah, same problem we had with
.patchwhere it now uses a list of original ids instead. Sinceupdatedoesn't support multiple updates, should it just remove the query?DaddyWarbucks commentedon Dec 2, 2023
I like the query because it throws a
NotFoundactually. I often use this for some security benefits where I stub on some extra params in the query serverside.DaddyWarbucks commentedon Dec 2, 2023
I am taking a deep dive on this new version of the adapter because I need some fixes/features for a particular project.
See: dove...DaddyWarbucks:feathers:mongodb/aggregate
So I will open a PR soon with
_getmethodparams.mongodbto be used with the aggregation frameworkDaddyWarbucks commentedon May 29, 2024
Closed via #3366