我今天正在研究MeteorJs,但卡住了这一点:Intermediate Meteor Tutorial #8 - Insert Permissions, Publishing & Meteor Toys。MeteorJs不会将数据添加到集合 - 我卡在中级流星教程的第8点
errorClass {error: 404, reason: "Method '/recipes/insert' not found", details: undefined, message: "Method '/recipes/insert' not found [404]", errorType: "Meteor.Error"…}
我检查了所有的代码。我试图将一些想法与“todos”教程结合起来。我甚至添加了不安全的自动发布软件包 - 但仍然出现错误。
如何在蒙古面板中看到截图中有Recipes集合。但是当我输入mongo shell:show collections时,它只显示“Users”集合。
我喜欢本教程的开始,我希望我能完成它,请帮我解决这个错误。
你有一种叫做'/ recipes/insert'的方法吗? –
不,用这个名字怎么可以调用方法?在本教程中,没有方法,但是我从其他更新的教程“todos”中复制了它,并且它没有工作,我删除了它,并且在当前教程中将其全部变成了类似。在这段代码中有这个允许出版: 'Recipes.allow({ 插入:功能(用户ID,DOC){ 回报!用户id;} } )' 也有发布和订阅的配方。 –
啊,我认为'/ recipes/insert'是一个内置的Meteor方法。您是否在客户端和服务器上执行'const recipes = new Mongo.Collection('recipes')'? –