0.0.8 • Published 5 years ago
mongodb-get-props v0.0.8
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'
}
})();