Meteor using a local connection results in error: insert failed: 404 — Method not found

混江龙づ霸主 提交于 2019-11-29 02:18:14

You need that Collection declaration on both the client and the server.

// common code, do not put under /client or inside Meteor.is_client test
Friends = new Meteor.Collection("Friends");

If you want to use Collection only on Client side and you don't need to save that data to server you can declare your collection in "client" folder or in .isClient() function by passing null to the constructor like this:

if(Meteor.isClient()){
// Some other code
...

onlyClientCollection = new Meteor.Collection(null);

// Some other code
...
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!