This package has been deprecated

Author message:

bad module, making a improved version

mongo-plus

0.2.3 • Public • Published

Mongo+ (mongo-plus)

The promise based easy-to-use MongoDB module

Installing Mongo+ For Use

To install mongo+ run the following command: npm install --save mongo-plus

Usage Of The Module

const Mongo = require("mongo-plus");
const Database = require("connection_url", "database"); // replace connection_url with the url you are connecting to, database to what database you want to access

Database.Connect().then(() => { // Connect to the database and wait for success
	Database.Create("random").then(col => console.log(col)); // create a collection
	Database.Drop("random"); // drop/delete a collection
	Database.Insert({ name: "hi" }, "random").then(doc => console.log(doc)); // insert a document
	Database.Remove({ name: "hi"}, [[name, "hi"]], "random"); // equivelent to db.collection.findOneAndRemove()
	Database.Update({ name: "hi" }, { aids: yes }, "random").then(() => {}); // update a document in a collection
	Database.Get({ name: "hi" }, "random").then(res => console.log(res)); // fetch a document from a collection
});

Package Sidebar

Install

npm i mongo-plus

Weekly Downloads

0

Version

0.2.3

License

Apache-2.0

Unpacked Size

4.32 kB

Total Files

3

Last publish

Collaborators

  • pyxelx