Saturday, 22 April 2017

node.js passport user schema set it manualy

first sorry for my english ;) second my question :

describtion : I have :

var mongoose = require('mongoose');
// define the schema for our user model
var userSchema = mongoose.Schema({
    facebook         : {
        id           : String,
        token        : String,
        email        : String,
        name         : String
    }
});
// create the model for users and expose it to our app
module.exports = mongoose.model('User', userSchema);

to use it with passport on a node.js .

...

var User = require('../app/models/user');

i dont connect to moongodb , since i use mysql to store my sessions .

the only stuff i dont understand is the _id value , comes it from passport , or sessions ?

question : what i have todo to get a user model (object) so it is working together with passport ? or are there some method i need anyway , so it is better to get the user model from mongoose ?

sincerley rakondark



via RakonDark

No comments:

Post a Comment