question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feathers Error When Sending Patch Request

See original GitHub issue

After trying to copy a patch request form the docs and running it, I keep getting a feathers error saying that BAD REQUEST 400: “Cast to ObjectId failed for value “{ name: ‘Hi’, completed: true }” at path “_id” for model “schools””. Can anyone help me?

Feathers vuex version: 3.10.4 code:

let data = { name: 'Hi', completed: true };
this.$store.dispatch('schools/update', [1, data, {}]);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
J3m5commented, Jun 12, 2020

This error come from feathers. Are you using Mongoose ? The error might happens because the number can"t be converted to a valid ObjectId.

1reaction
coderinblack08commented, Jun 12, 2020

🙏🙏🙏🙏🙏 Thanks so much, Better read the documentation properly next time 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while making a PATCH method call · Issue #87
I was looking to send atomic updates to my server and in doing so required a PATCH call to be made. But the...
Read more >
Errors | feathers
The following error types, all of which are instances of FeathersError , are available: ... All of the Feathers core modules and most...
Read more >
Why after upgrade feathersjs I receive error
The problem was mostly with remove and patch . If you don't limit the query in a multi remove it can e.g. be...
Read more >
How to use the superagent.patch function in ...
it('should deny access to updating tokens', function(done) { request.patch('/api/v1/tokens/1234').send({}).end(hlp.status(401, done)); });.
Read more >
feathers-mongoose
Start using feathers-mongoose in your project by running `npm i ... property is also useful for performing upserts on a patch request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found