var a = new Schema({ name: '’, b_id: {type: Schema.ObjectId, ref: 'b’} });
var b = new Schema({ name: '’, });
a: {name: '1’, b_id: '…’} {name: '2’, b_id: '…’} {name: '3’, b_id: '…’}
b: {name: 'b1’} {name: 'b2’} {name: 'b3’}
a.find({}) .populate({ path: 'b_id’, match: {’name’: 'b1’} }) .exec(callback);
怎么实现Inner Join ??
4 回复