流星アプリでコレクションを更新しようとすると、次のエラーが発生します。
更新に失敗しました:403-アクセスが拒否されました。制限されたコレクション内のドキュメントを置き換えることはできません。
サーバーには次のコードがあります。
Songs = new Meteor.Collection("songs");
PlayLists = new Meteor.Collection('playlists');
PlayChannels = new Meteor.Collection('playchannels');
Meteor.publish('songs', function () {
return Songs.find();
});
Meteor.publish('playlists', function () {
return PlayLists.find();
});
Meteor.publish('playchannels', function () {
return PlayChannels.find();
});
Meteor.startup(function () {
Songs.allow({
insert: function () { return true; },
update: function () { return true; },
remove: function () { return true; },
fetch: function () { return true; }
});
PlayChannels.allow({
insert: function () { return true; },
update: function () { return true; },
remove: function () { return true; },
fetch: function () { return true; }
});
PlayLists.allow({
insert: function () { return true; },
update: function () { return true; },
remove: function () { return true; },
fetch: function () { return true; }
});
});
そして、私は次のように電話をかけています:
PlayChannels.update({_id: Session.get('playchannel')},{current:Session.get('current')});
私は何が間違っているのですか?