mongodb-get-props

0.0.8 • Public • Published

Build Status

install

npm i mongodb-get-props --save

usage

const getProps = require('mongodb-get-props')
 
;(async () => {
 
  const MongoClient = require('mongodb').MongoClient;
 
  const uri = 'mongodb://localhost:27017/db'
 
  const client = await MongoClient.connect(uri,{ useNewUrlParser: true });
 
  // database and collection name
  await getProps(client.db('project'), 'song')
 
  // sample output
  {
    __v: 'int',
    _id: 'objectId',
    artist_name: 'string',
    created_at: 'date',
    track_name: 'string',
    updated_at: 'date'
  }
 
})();

Package Sidebar

Install

npm i mongodb-get-props

Weekly Downloads

9

Version

0.0.8

License

MIT

Unpacked Size

122 kB

Total Files

7

Last publish

Collaborators

  • cond