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.

Hook result data shouldn't have sequelize info

See original GitHub issue

When using hooks on sequelize services hook.result has a lot of extra properties on it then just the data. This makes modifying the result data confusing.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ekryskicommented, Aug 25, 2016

@petermikitsh @bedeoverend we have been talking about doing a breaking change to both feathers-sequelize and feathers-mongoose so that services are initialized with {raw: true} and {lean: true} respectively. @daffl saw some pretty massive performance improvements with using lean vs. without.

1reaction
marshallswaincommented, Mar 7, 2016

This is the expected result of using an ORM. That data can be really useful in other scenarios, so it’s generally better to use Sequelize’s methods to convert the model instance to an object. See here for ways of doing this:

http://stackoverflow.com/questions/21961818/sequelize-convert-entity-to-plain-object

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sequelize ORM, Hooks not working with associations
For anyone who is facing this issue, what worked for me is configuring belongsToMany associations with a model.
Read more >
Hooks - Sequelize
Hooks (also known as lifecycle events), are functions which are called before and after calls in sequelize are executed.
Read more >
MySQL Connection With Node.js Using Sequelize and Express
js environment, here are the steps to follow: Open an Express web server; Add the configuration data for an existing MySQL database; Open...
Read more >
Adding Postgres Search to a Node REST API
And thirdly, databases shouldn't matter to the REST endpoint. ... Before hooks are great for modifying data to fit a DB schema or ......
Read more >
FAQ · Feathersjs
We've been collecting some commonly asked questions here. ... For any of the feathers database/ORM adapters you can just use hooks to fetch...
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