Posting data to Meteor's MongoDB collection Posting data to Meteor's MongoDB collection curl curl

Posting data to Meteor's MongoDB collection


Take a look at DDP, Meteor uses this protocol to communicate between client and server. DDP is simple and based on JSON. Meteor’s DDP currently based on WebSockets and SockJS. That's very helpful. I have a case that Websocket cannot work in local LAN network but the connection fall back to SockJS, then everything work fine, that's great!

An example implement DDP communication between Meteor and Python.Simply create a Meteor method:

Meteor.methods({  clientProcessData: function (data) {    console.log(data);    // Meteor post data to MongoDB code here  },

Follow the instructions from https://github.com/hharnisc/python-meteor to install python-meteor client and connect to Meteor server.

You can call Meteor method from Python by:

client.call('clientProcessData', ["This is a test"], callback_function)

Not sure are there any other DDP clients of other programming language, but in my case, python works great!

// Update: There are many of them, but I'm so new here that afraid of posting external link, so please do a simple "DDP client" search on google.