Skip to content
Permalink
7914eee056
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
22 lines (17 sloc) 467 Bytes
'use strict'
// import the mongoose package
const mongoose = require('mongoose')
const db = {
user: 'testuser',
pass: 'password'
}
mongoose.connect(`mongodb://${db.user}:${db.pass}@ds143777.mlab.com:43777/marktyers`)
mongoose.Promise = global.Promise
const Schema = mongoose.Schema
// create a schema
const listSchema = new Schema({
name: String,
list: [{type: String}]
})
// create a model using the schema
exports.List = mongoose.model('List', listSchema)