These are chat archives for Automattic/mongoose

Jun 2016
Jan Koppe
Jun 16 2016 08:05
Hey, trying to add a static function to my model. If i call this.Update inside the function, it returns a TypeError, this.Update is not defined. What's going wrong there? can't see a difference from my code to the documentation. Running in node 6.2
Mikołaj Stolarski
Jun 16 2016 08:06
It's static method so it need be called from Model consturctor object ex. Model.Update()
to call this.Update you need add it to methods instead of statics
Jan Koppe
Jun 16 2016 08:08
Ugh, of course, now I see why. It's a instance function, not a class function. my bad. thanks!