1.2.2 • Published 6 years ago

mongo-connect-sync v1.2.2

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

npm version build status coverage status

Similarly to other DBs, let's allow a "synchronous" access to the MongoDB driver pool

const db = require('mongo-connect-sync')('mongodb://localhost:27017/connect-sync-test');

const coll = db.collection('foo');
coll.insertOne({bar: 2}).then(() => {
	coll.find({}).limit(5).toArray().then(console.log);
});

is equivalent to:

const MongoClient = require('mongodb');

MongoClient.connect('mongodb://localhost:27017/connect-sync-test')
	.then(db => {
		const coll = db.collection('foo');
		coll.insertOne({bar: 2}).then(() => {
			coll.find({}).limit(5).toArray().then(console.log);
		});
	});
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago