Created
January 17, 2019 22:20
-
-
Save prashanthmadi/23f4caeb3703f9424e4db2886a74ab4b to your computer and use it in GitHub Desktop.
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
var mongoose = require('mongoose') | |
const db = mongoose.connect('mongodb://mongo1234:Shrk6VZMbwCjEV0Fwmz2m3qHx3qhdQMAaLw52pKOrWCji2NhOOHEJVM6W51SKiDLv5a5pQRUybwABnGKRwDy4A==@mongo1234.documents.azure.com:10255/d1?ssl=true&replicaSet=globaldb',{useNewUrlParser: true}); | |
var Schema = mongoose.Schema; | |
var schema = new Schema({ name: String },{ shardKey: { name: 1 }}); | |
const Cat = mongoose.model('Cat',schema); | |
//Cat.create({name: 'Zildjian'}); | |
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