【发布时间】:2014-12-08 14:00:15
【问题描述】:
我正在尝试实现用户关注用户,我有
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var UserSchema = new Schema({
name: String,
following: [{
type: Schema.Types.ObjectId,
ref: 'User'
}]
});
var User = mongoose.model('User',UserSchema);
所以现在,作为用户,我想要获得我的关注者列表。
【问题讨论】:
标签: recursion mongoose associations schema