Skip to content

Instantly share code, notes, and snippets.

@aramkoukia
Created December 28, 2017 21:49
Show Gist options
  • Select an option

  • Save aramkoukia/2b24a7d8dc0cf391903c37acc108d8e2 to your computer and use it in GitHub Desktop.

Select an option

Save aramkoukia/2b24a7d8dc0cf391903c37acc108d8e2 to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const todoSchema = new Schema(
{
id: { type: Number, required: true, unique: true },
name: String,
saying: String
},
{
collection: 'todoes',
read: 'nearest'
}
);
const ToDo = mongoose.model('ToDo', todoSchema);
module.exports = ToDo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment