M
M
Matvey Kukuy2014-08-06 22:21:11
JavaScript
Matvey Kukuy, 2014-08-06 22:21:11

How to store temporary data in mongoose model?

Good evening friends!
Learning nodejs after python and implementing classic mvc. I need to perform a number of calculations on the models and I really need to store some temporary data in these same models during these calculations. Moreover, this temporary data does not need to be reflected in the database at all.
Mongoose has the ability to add its own methods to the model - methods, or static. But can't these methods save something to an object at runtime? I tried to refer to this inside, I also tried to do it through virtuals.
Is it really necessary to wrap everything as described here: habrahabr.ru/post/139719 ? This would be extremely redundant.
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question