Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanhuay/micron-mongoose-update-vs-save
Benchmark between mongoose update and "find and after save"
https://github.com/ivanhuay/micron-mongoose-update-vs-save
benchmark micron-runner mongoose
Last synced: 25 days ago
JSON representation
Benchmark between mongoose update and "find and after save"
- Host: GitHub
- URL: https://github.com/ivanhuay/micron-mongoose-update-vs-save
- Owner: ivanhuay
- Created: 2019-06-11T13:05:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T12:11:28.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T21:08:42.508Z (about 1 month ago)
- Topics: benchmark, micron-runner, mongoose
- Language: JavaScript
- Size: 256 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# 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](https://github.com/ivanhuay/hiroki) should works.## Hiroki Internal functionality:
In the past, some implementation of the library used the `pre-save` [method](https://mongoosejs.com/docs/middleware.html#pre) 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](https://ivanhuay.github.io/micron-mongoose-update-vs-save/)
![Alt image](./img/results.png)## run the test
```
git clone https://github.com/ivanhuay/micron-mongoose-update-vs-save.gitcd micron-mongoose-update-vs-save
npm i
npm run test
```after running that the results should be on the docs folder.