我的Meteor发布时出现了一些有线问题,当我有findOne它可以工作,但发现它没有和findOne我得到一个游标错误.
这是我的代码
Meteor.publish('organizations', function() {
var user = Meteor.users.findOne(this.userId);
if(!user) return '';
var debugTest = Organizations.findOne(user.organizationId);
console.log(debugTest._id);
//return Organizations.findOne({_id: user.organizationId});
});
Run Code Online (Sandbox Code Playgroud)
为此,我得到了不确定
如果我做以下事情
Meteor.publish('organizations', function() {
var user = Meteor.users.findOne(this.userId);
if(!user) return '';
console.log(user.organizationId);
var debugTest = Organizations.findOne(user.organizationId);
console.log(debugTest._id);
//return Organizations.findOne({_id: user.organizationId});
});
Run Code Online (Sandbox Code Playgroud)
我找回了两个ID但是返回时我得到以下错误
我是NvoF9MimZ6tJ95c3m NvoF9MimZ6tJ95c3m
来自子KLnQphHTXmQcjEi2D的错误异常错误:发布函数只能返回Cursor或Cursors数组
| 归档时间: |
|
| 查看次数: |
4229 次 |
| 最近记录: |