Skip to content

ivanhuay/micron-mongoose-update-vs-save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongoose: Update vs FindOne and save

this is a mongoose benchmark between find and save and make and update.

Motivation:

This test is for measure the performance impact using both methods to take a desition about how Hiroki should works.

Hiroki Internal functionality:

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.

Results:

Doing a findOne or just a find takes more than 2x time compared to update native method.

view results HERE Alt image

run the test

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.

About

Benchmark between mongoose update and "find and after save"

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published