Answer the question
In order to leave comments, you need to log in
How to process incoming Bookshelf.js data before saving?
Good afternoon.
I am using Bookshelf.js ORM on my project. And now I want to somehow process them in the model before saving the incoming data to the table. Not Validate(or Validator), but change some data.
Have you used this library?
If used, please explain to me how to implement it?
I searched a lot in the documentation about this, but did not find it ... Maybe you will succeed. Here is the documentation .
By means of a method I save()
save in a DB.
Example:
await new ModelName({name: 'Name', email: '[email protected]'}).save()
Answer the question
In order to leave comments, you need to log in
Most likely you need creating/saving
bookshelfjs.org/#Model-event-creating events
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question