Snippets

Nikolay Galkin 4r7jp: Untitled snippet

Created by Nikolay Galkin last modified
'use strict';

const mongoose = require('mongoose');

mongoose.connect('mongodb://user:pass@host'); // @todo: via config

mongoose.cons = {
  tech:  mongoose.useDb('techdata'),
  graph: mongoose.useDb('graph')
}
1
2
3
4
5
6
7
8
9
const mongoose = require('mongoose');
const Schema   = mongoose.Schema;


const schema = new Schema({
  title: {type: String}
});

mongoose.cons.tech.model('ModelName', schema)

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.