我有一个文档结构
var RelationshipSchema = new mongoose.Schema({
followee: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
follower: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
start: {
type: Date,
default: Date.now
},
end: {
type: Date
}
})
如果我有userId我将如何查询以计算同一给定userId的followee和follower。 并返回结果?