Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 30, 2018 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/c164cf94547932e580814b2449f6aa2f to your computer and use it in GitHub Desktop.
Save amandeepmittal/c164cf94547932e580814b2449f6aa2f to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose');
mongoose.connect(
'mongodb://localhost:27017/test',
{ useNewUrlParser: true }
);
const Cat = mongoose.model('Cat', { name: String });
const kitty = new Cat({ name: 'Zildjian' });
kitty.save().then(() => console.log('meow'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment