Hey everybody Im new with node and mongo hope for your help with it.I defined a user schema with mongoose:
var userSchema = mongoose.Schema({local : { email : String, password : String, name : String},facebook : { id : String, email : String, token : String, firstName : String, familyName : String},google : { id : String, email : String, token : String, firstName : String, familyName : String}});
Im tring to fetch all the users (from local google and facebook) with specific email.How do I write it ? I tried something like:
var User = require('./models/user');app.get('/api/user/:email',function(req,res){ User.findOne({'email':req.params.email},function(err,user){ res.json(user); })});
How do I fix it ?Thanks.