-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
Steps to reproduce
Have a feathers-mongoose service configured, then try to patch a document whose ID doesn't exist:
app.service('service').patch(id, { some: 'value' }, {
mongoose: { upsert: true }
});Expected behavior
It should work just the same as the below:
app.service('service').update(id, { some: 'value' }, {
mongoose: { upsert: true }
});Actual behavior
It fails with Not Found error.
Seems to be because passing an ID means that a get will be executed, and it throws.
Unlike not passing an ID, as it will make a find, which doesn't throw when no documents are found.
System configuration
Module versions:
NodeJS version: 12.16.1
Operating System: MacOS
Browser Version: N/A
React Native Version: N/A
Module Loader: N/A
Metadata
Metadata
Assignees
Labels
No labels