Created
July 2, 2017 05:04
-
-
Save midnightcodr/112491378e76a9d52bbee1d032f07093 to your computer and use it in GitHub Desktop.
using mongoose 4.11.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose') | |
mongoose.Promise = require('bluebird') // optional, use this to get rid of | |
// the mpromise DeprecationWarning | |
const conn = mongoose.createConnection('mongodb://localhost/testDB') | |
const Schema = mongoose.Schema | |
const UserSchema = new Schema({ | |
username: String, | |
email: String | |
}) | |
const User = conn.model('User', UserSchema) | |
module.exports = User |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment