Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- POST /users/addfollower 500 2.353 ms - 1410
- console.log("Id da aggiungere ai follower: " + req.body.idf);
- console.log("Id utente:" + req.user._id);
- auth.findAndUpdate({_id: req.user._id}, {$push: {'amici': {"user": req.body.idf}}}).exec(function(err,res){
- //
- });
- const authschema = mongoose.Schema({
- _id: mongoose.Schema.Types.ObjectId,
- username: String,
- nome: String,
- cognome: String,
- email: String,
- password: String,
- cookie: String,
- pp: String,
- descrizione: String,
- autenticazione: Boolean,
- token: String,
- amici: [{
- user: String
- }]
- });
- const auth = new Auth({
- _id : new mongoose.Types.ObjectId(),
- username: req.body.username,
- nome: req.body.nome,
- cognome: req.body.cognome,
- email: req.body.email,
- password: hash,
- pp: "/uploads/user.png",
- descrizione: "Aggiungi qui la tua descrizione",
- autenticazione: false,
- token: token,
- amici: [{
- user: "start"
- }]
- });
- auth.findAndUpdate({_id: req.user._id}, {$push: {'amici': {"user": req.body.idf}}}).exec(function(err,res){
- //
- });
- auth.findAndUpdate({_id: req.user._id}, {$push: {'amici': [{"user": req.body.idf}]}}).exec(function(err,res){
- //
- });
- const amiciSchena = mongoose.Schema({
- name: String
- });
- const authschema = mongoose.Schema({
- _id: mongoose.Schema.Types.ObjectId,
- username: String,
- nome: String,
- cognome: String,
- email: String,
- password: String,
- cookie: String,
- pp: String,
- descrizione: String,
- autenticazione: Boolean,
- token: String,
- amici: [amiciSchena]
- });
Add Comment
Please, Sign In to add comment