https://github.com/cdimascio/mongoose-compose-example
An example to quickly get your up and running with Mongoose and MongoDB on IBM Compose.io.
https://github.com/cdimascio/mongoose-compose-example
compose mongo mongodb mongoose node-js
Last synced: 2 months ago
JSON representation
An example to quickly get your up and running with Mongoose and MongoDB on IBM Compose.io.
- Host: GitHub
- URL: https://github.com/cdimascio/mongoose-compose-example
- Owner: cdimascio
- Created: 2018-01-03T04:14:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-03T05:13:16.000Z (over 8 years ago)
- Last Synced: 2025-03-29T11:33:21.729Z (about 1 year ago)
- Topics: compose, mongo, mongodb, mongoose, node-js
- Language: JavaScript
- Homepage: https://medium.com/@cdimascio/mongoose-and-ibm-compose-io-b0ccc715f539
- Size: 2.93 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mongoose-compose-example
An example to quickly get your up and running with MongoDB on IBM Compose.io.
This example shows how to use a custom MongoDB database, instead of the default `admin` db.
## Setup
1. In the project root, create the file `mongo.cert`
2. Populate `mongo.cert` with your Compose.io MongoDB certificate
3. Open `index.js`
4. Update line 9 with your MongoDB url.
**Note** When using Mongoose, the default Compose.io MongoDB connection string only works with the `admin` db. To use a custom db, you must restructure the connection string according the the format described in [the code](/index.js) and below.
**URL Format**
```shell
mongodb://admin:admin@host1.com:27018,host2:27018/myDb?ssl=true&authSource=admin
```
5. Execute `node index`
**Star** this repo if this helps
Happy coding!
# License
MIT