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

后端 未结 2 1537
滥情空心
滥情空心 2020-12-16 04:00

I\'ve got a meteor collection on the client side

Friends = new Meteor.Collection(\"Friends\");
Meteor.subscribe(\"Friends\");

I have a user

2条回答
  •  庸人自扰
    2020-12-16 04:28

    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
    ...
    }
    

提交回复
热议问题