Browse Source

adding model

Herton 7 years ago
parent
commit
d5f614c85a
2 changed files with 19 additions and 0 deletions
  1. 5 0
      config/index.js
  2. 14 0
      models/todoModel.js

+ 5 - 0
config/index.js

@@ -0,0 +1,5 @@
+module.export = {
+	getDbConnectionString: function() {
+		return 'mongodb://' + process.env.MONGO_USER + ':' + process.env.MONGO_PASWORD + '@127.0.0.1:27017/todo';
+	}
+}

+ 14 - 0
models/todoModel.js

@@ -0,0 +1,14 @@
+vat mongoose = require('mongoose');
+
+var Schema = mongoose.Schema;
+
+var todoSchema = new Schema({
+	username: String,
+	todo: String,
+	isDone: Boolean,
+	nasAttachement: Boolean
+});
+
+var Todos = mongoose.model('Todos', todoSchema);
+
+module.export = Todos;