Created
June 12, 2013 19:09
-
-
Save mythicalprogrammer/5768191 to your computer and use it in GitHub Desktop.
Mongoose Connect to DB (named rift) and querying for a user by email.
This file contains hidden or 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'), | |
Admin = require('./models/admin'); | |
var connStr = 'mongodb://localhost:27017/rift'; | |
mongoose.connect(connStr, function(err) { | |
if (err) throw err; | |
console.log('Successfully connected to Mongo'); | |
}); | |
Admin.findOne({ email:'[email protected]' }, | |
function(err, admin) { | |
console.log(admin); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment