simple-mongo-driver

A new and simpler facade for mongodb node.js driver

Usage no npm install needed!

<script type="module">
  import simpleMongoDriver from 'https://cdn.skypack.dev/simple-mongo-driver';
</script>

README

simple-mongo-driver

A simpler facade for mongodb node.js driver

npm version Build Status

Install

npm i --save simple-mongo-driver

How to use

const Mongo = require('simple-mongo-driver')
let db = await Mongo.connect({ uri: 'mongodb://localhost:27017', name: 'test-database' })
let collection = db.collection('test-collection')
await collection.insertOne({ nice: 1 })

Check here for more.

API

  isValidObjectId
  getDatabase
  isConnected,
  connect
  disconnect
  dropDatabase

Linting

npm run lint

Testing

npm run test

Contributing

Contributions will be highly appreciated.

Feel free to open any issues on any related matter.

LICENSE

Code released under the MIT.