Created
January 29, 2017 10:48
-
-
Save slaith/d6093b66ca0fd9000f8bc34d087c8e86 to your computer and use it in GitHub Desktop.
gist
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 MongoClient = require('mongodb').MongoClient | |
, assert = rsuequire('assert'); | |
// Connection URL | |
var url = 'mongodb://localhost:27017/myproject'; | |
// Use connect method to connect to the server | |
MongoClient.connect(url, function(err, db) { | |
assert.equal(null, err); | |
console.log("Connected successfully to server"); | |
var comments=db.collection("comments"); | |
db.close(); | |
}); | |
module.exports= MongoClient |
extends layout
block content
.container
form.form-horizontal(role='form' action="/comments" method="post")
h2 Add Event
.form-group
label.col-sm-3.control-label(for='firstName') Name
.col-sm-9
input#firstName.form-control(type='text', placeholder='Full Name', name="name" autofocus='')
span.help-block Name of the event
.form-group
label.col-sm-3.control-label(for='birthDate') Start Date
.col-sm-9
input#birthDate.form-control(type='date', name="startdate")
.form-group
label.col-sm-3.control-label(for='City') City
.col-sm-9
select#country.form-control(name="City")
option New Delhi
option Gurgaon
option Noida
option Bengaluru
option Mumbai
option Kolkata
option Chennai
// /.form-group
.form-group
.col-sm-9.col-sm-offset-3
button.btn.btn-primary.btn-block(type='submit') Create
// /form
// ./container
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var mongoose = require("mongoose");
var CommentSchema = new mongoose.Schema({
text: {
type: String
},
equipped: Boolean,
user: {type:String},
});
var Comment = mongoose.model('Comment', CommentSchema);
module.exports = {
Comment: Comment
}