this is a mongoose benchmark between find and save
and make and update
.
This test is for measure the performance impact using both methods to take a desition about how Hiroki should works.
In the past, some implementation of the library used the pre-save
method of mongoose. For keeping that working we decided to execute a find
and after a save
.
Doing a findOne
or just a find
takes more than 2x time compared to update
native method.
git clone https://github.com/ivanhuay/micron-mongoose-update-vs-save.git
cd micron-mongoose-update-vs-save
npm i
npm run test
after running that the results should be on the docs folder.