我想从存款和coin_info集合中获取硬币ID的数据 同样在两个系列中。
我可以在这种情况下使用填充吗?如果是的话怎么样?
var mongoose=require('mongoose');
var data=mongoose.Schema({
user_id:{type:String},
coin_key:{type:String},
address:{type:String},
label:{type:String}
});
var coin_info=mongoose.Schema({
coin_name:{type:String},
_id:{类型:字符串} });
var deposte_model=mongoose.model('deposit',data);
var get_coin_info=mongoose.model('coin_infos',coin_info);
module.exports.get_deposite_history =
function(object_id,coin_id,callback) {
var query={user_id:object_id,coin_key:coin_id};
deposte_model.find(query,function(err, teams) {
callback(err, teams);
});
}