服务器:
dbHandleremp = new Meteor.Collection("emp");
Meteor.publish("emp", function(email) {
return dbHandleremp.find({
"email": email
});
});
客户:
dbHandleremp = new Meteor.Collection("emp");
var dbempQuery =Meteor.subscribe('emp', "a@a.com", function() {
dbHandleremp.find();
});
console.log(dbempQuery);
如何从“dbempQuery”中获取值
答案 0 :(得分:1)
if(Meteor.subscribe('emp', "a@a.com").ready()){
var result = emp.find({}).fetch();
console.log(result);
}
答案 1 :(得分:0)
Meteor.subscribe("emp", "a@a.com",{
onReady: function () {
var dbempQuery = emp.find({}).fetch();
console.log(dbempQuery);
}
});