Nimble Polyglot Microcosm

    @metamodules/mongo

    1.1.1 • Public • Published

    MongoDB Meta-Module CircleCI npm version

    For use with create-node-app and deploy-node-app

    To add this metamodule to your project:

    npm install @metamodules/mongo
    
    // This "just works" both in development and production!
    const mongo = require('@metamodules/mongo')()
    
    var kittySchema = new mongo.Schema({
      name: String
    })
    
    var Kitten = mongo.model('Kitten', kittySchema)
    
    var fluffy = new Kitten({ name: 'fluffy' })
    fluffy.save(function(err, fluffy) {
      if (err) return console.error(err)
    
      Kitten.find(function(err, kittens) {
        if (err) return console.error(err)
        console.log(kittens)
      })
    })

    This is a simple wrapper around the mongoose module and includes the latest stable MongoDB image. This module exposes an instances of a mongoose Connection.

    Keywords

    none

    Install

    npm i @metamodules/mongo

    DownloadsWeekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    7.77 kB

    Total Files

    18

    Last publish

    Collaborators

    • erulabs
    • pastudan