Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not call update with a null id #214

Closed
apparentvisuals opened this issue Sep 25, 2017 · 1 comment
Closed

Can not call update with a null id #214

apparentvisuals opened this issue Sep 25, 2017 · 1 comment

Comments

@apparentvisuals
Copy link

Steps to reproduce

The services section of Feathers documentations states:

update(id, data, params) -> Promise - replaces the resource identified by id with data. The method should return a Promise with the complete updated resource data. id can also be null when updating multiple records with params.query containing the query criteria.

However, when using feathers-mongoose and calling update(null, data, param) throws

'Not replacing multiple records. Did you mean patch?' exception

Expected behavior

Update call should succeed

Actual behavior

Update call fails with BadRequest

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):
[email protected]

NodeJS version:
8.5.0

Operating System:
Ubuntu 16.04

@daffl
Copy link
Member

daffl commented Sep 25, 2017

This is by design since there isn't a lot of cases where you want to blow away an entire set of data and replace it with the same data. This is also documented in the database adapter specific API:

Does not allow replacing multiple records (id can't be null).

@daffl daffl closed this as completed Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants