0.0.17 • Published 5 years ago

@yevheni/mangodb v0.0.17

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

MangoDB

Simple MongoDB wrapper based on mongoose and shortid

Installation

npm install --save @yevheni/mangodb

Usage

const MangoDB = require("@yevheni/mangodb").MangoDB;
// or
import {MangoDB} from "@yevheni/mangodb";

const mango = new MangoDB("mongodb://localhost:27017/mango", {
    useNewUrlParser: true
});
mango.collection("test").create({
    test: true
}).then(test => {
    // do something
}).catch(err => console.error(err));

Reference

new MangoDB(url, options)

  • url: String

    MongoDB connection url (see mongoose docs)

  • options: Object

    MongoDB connection options (see mongoose docs)

collection(name)

  • name: String

    Collection name. Returns Mongoose Model

drop()

Drops database. Returns Promise and resolves after drop success

connection

Returns Mongoose Connection

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5-alpha1

5 years ago

0.0.5

5 years ago

0.0.4-a1

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago