J
J
Jedi2018-11-03 10:21:03
JavaScript
Jedi, 2018-11-03 10:21:03

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()

Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antony Tkachenko, 2018-11-03
@PHPjedi

Most likely you need creating/saving
bookshelfjs.org/#Model-event-creating events

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question