https://github.com/jsa2/mongodbpools
https://github.com/jsa2/mongodbpools
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jsa2/mongodbpools
- Owner: jsa2
- Created: 2021-10-03T18:37:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-03T18:39:00.000Z (over 4 years ago)
- Last Synced: 2025-03-14T13:43:09.311Z (about 1 year ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Readme
Testing reusing of connections in MongoDb
- https://stackoverflow.com/a/46871946
Based on various examples at
- https://stackoverflow.com/questions/10656574/how-do-i-manage-mongodb-connections-in-a-node-js-web-application
### Setup
1. Database users
2. Collection persons
3. add connectionstring to src/cfg.json
```json
{"uri":"mongodb://..."}
```
### Test
```powershell
Invoke-RestMethod yourhost.com/persons -Method Post -UseBasicParsing -Body '{"uid":12}' -ContentType application/json
Invoke-RestMethod yourhost.com/persons -Method Post -UseBasicParsing -Body '{"uid":12}' -ContentType application/json
```