Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling method on meteor #10

Open
ofqwx opened this issue Oct 19, 2016 · 1 comment
Open

calling method on meteor #10

ofqwx opened this issue Oct 19, 2016 · 1 comment

Comments

@ofqwx
Copy link

ofqwx commented Oct 19, 2016

Hi, I'm trying to use the function call with no success, I'm doing exactly like the docs with no errors but the meteor method no called. I'm using meteor 1.4 and python 2.7. Thanks.

@mvgalle
Copy link

mvgalle commented Apr 19, 2017

Hi @ofqwx , at minimum you should be able to connect to your meteor method by doing something like the following, where 127.0.0.1 is localhost, and 3000 is the port you are running your app on.

Using PYTHON 3

Setup and Connect Using DDP

client = DDPClient('ws://127.0.0.1:3000/websocket')
client.connect()
client.call('nameOfMeteorMethodHere', [paramToSend1,paramToSend2])
client.close()

METEOR METHOD:

Meteor.methods({
nameOfMeteorMethodHere: function(param1,param2){
//To debug, log your params...
console.log('called nameOfMeteorMethodHere');
console.log(param1);
console.log(param2);
//Do Something with the params...
CollectionName.update({_id: param1}, {$set: {param2: param2}});
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants