JKHeadley / JKHeadley/rest-hapi
Change mongoose database dynamically
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 155
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to do something simple enough, but can't figure it out for the life of me.
I am trying to change the database before using ```RestHapi.create()``` call.
I have a config file which has the basic configuration setup and i need to change that dynamically for a certain functionality.
My config file creates a manifest, exactly like in ```appy-backend``` , another project by Author of this project.
I have tried using ```RestHapi.config.mongo.URI = "mongodb://localhost:27017/new_db_name";``` but still it doesn't change the database.
I can provide any other details that might be needed to solve this.
Please help.
Contributor guide
Research direction
Begin with the config manifest and the RestHapi.config.mongo.URI assignment, then trace how RestHapi.create() reads it; compare the corresponding setup in appy-backend. The expected timing and supported mechanism for changing the MongoDB database need clarification before implementation, and done should include a reproducible dynamic configuration path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, node.js
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100