Reputation: 1
Hi could someone explain to me how I would write a simple friendship relationship in mongoose
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var User = new Schema({
username:{
type: String,
unique: true,
required: true
},
password:{
type: String,
required: true
},
friends:{[
// stuck here How would i define what another user is here
]}
}
});
Upvotes: 0
Views: 531