feathersjs-ecosystem / feathers-mongodb

A mongodb service for feathers
MIT License
122 stars 44 forks source link

Isn't update, patch, and remove supposed to support query like behavior? #21

Closed rmoskal closed 8 years ago

rmoskal commented 8 years ago

I'm looking at the feathers docs here: patch(id, data, params [, callback]) merges the existing data of the resource identified by id with the new data. id can also be null indicating that multiple resources should be patched.

It seems to me that you're supposed to be able to pass a null in for the id and then I suppose the query criteria would be in params?

Do the other feathers database adapters not work like this? It seems like it would just be a matter of using the collection.update function.

Is this on the agenda :). If not, maybe I'll take a crack at it next week.

daffl commented 8 years ago

Currently, the official MongoDB adapter that supports this functionality is feathers-mongoose (which should be documented at http://docs.feathersjs.com/databases/readme.html).

feathers-mongodb has not been updated yet (see issue #16). It would be great to get some help with this. @joshuajabbour also offered to migrate to mongo-native in #20. My suggestion is:

  1. @joshuajabbour migrates the current plugin to mongo-native
  2. you could then add delete and patch many (with a null id) support
  3. after that I will update the plugin to ES6 and the new tests

Sounds good?

rmoskal commented 8 years ago

Ahh, now I see what happened. My client/work mates didn't want to use the mongoose idiom, which puzzled me.

I'm in the middle of trying to ship some code, but I probably have some time towards the end of the month.

Best,

Robert

On Fri, Feb 5, 2016 at 7:41 PM David Luecke notifications@github.com wrote:

Currently, the official MongoDB adapter that supports this functionality is feathers-mongoose https://github.com/feathersjs/feathers-mongoose/ (which should be documented at http://docs.feathersjs.com/databases/readme.html).

feathers-mongodb has not been updated yet (see issue #16 https://github.com/feathersjs/feathers-mongodb/issues/16). It would be great to get some help with this. @joshuajabbour https://github.com/joshuajabbour also offered to migrate to mongo-native in #20 https://github.com/feathersjs/feathers-mongodb/issues/20. My suggestion is:

  1. @joshuajabbour https://github.com/joshuajabbour migrates the current plugin to mongo-native
  2. you could then add delete and patch many (with a null id) support
  3. after that I will update the plugin to ES6 and the new tests

Sounds good?

— Reply to this email directly or view it on GitHub https://github.com/feathersjs/feathers-mongodb/issues/21#issuecomment-180636849 .


Robert Moskal Most Media Brooklyn, USA

ekryski commented 8 years ago

Ah :hankey: this makes me :cry: because I made the call to be lazy and not update the mongodb adapter. I'll try and get it updated in the next day or so. Migration shouldn't be too bad. Just how the connection is passed and how the service is set up will change.

ekryski commented 8 years ago

Closed by #24