Answer the question
In order to leave comments, you need to log in
What is the right way to allow users to make friends on Backbone)?
And so, there is a mongo user model
var userSchema = new Schema({
name:{
required: true,
type: String
},
email:{
unique: true,
required: true,
type: String
},
password:{
required: true,
type: String
},
admin: {
type: Boolean,
default: false
}
});
var userSchema = new Schema({
name:{
required: true,
type: String
},
email:{
unique: true,
required: true,
type: String
},
password:{
required: true,
type: String
},
admin: {
type: Boolean,
default: false
},
friends: []
});
vasya.friends
{
id: '56cc82a5244575d800d1acab', // пети _id
status: outcomeRequest
}
petya.friends
{
id: '76cc8d5fbf31sf8ac06cffc5a', // васи _id
status: incomeRequest
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question