What is this repository for?
- This repository is a complete MongoDB provider for MyDoma APIs and other projects
How do I get set up?
Install
npm i @mydoma/myd-provider
Initialise
Myd-provider is basically a wrapper for a mongodb database. When you initialise, you need to pass in a connections string, and you can also set Mongo options.
const db = require('@mydoma/myd-provider')
const connection = 'mongodb://localhost:27071/myd-studio'
const options = {
sslCA: certFileBuf
}
db.connect(connection, options).then(() =>
console.log(`connected to ${dbHost}`)
)
###Using the provider
Basically, you can call the provider's methods on any of its collections, but not every collection implements every method.
db.Product.duplicate(id)
Current implementation
Who do I talk to?