0.0.1 • Published 5 years ago

@nodeapp/mongo v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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 @nodeapp/mongo
// This "just works" both in development and production!
const mongo = require('@nodeapp/mongo')()

var kittySchema = new mongoose.Schema({
  name: String
})

var Kitten = mongoose.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.