Question

I have a meteor app in which I am using a mongoDB ObjC driver to write to it from an ios app. This works fine when the meteor app is running locally (port 3000). I simply use dbConn = [MongoConnection connectionForServer:@"127.0.0.1:3002" error:&error]; The problem is once I deploy the app to meteor.com. I can find the ip address by using ping whatever.meteor.com but where do I go from there. I don't know how to write to the deployed mongoDB. It should be fairly simple, but I can't seem to figure it out. Thanks.

Was it helpful?

Solution

To get temporary mongodb credentials run this command:

meteor mongo whatever.meteor.com --url

Source: https://stackoverflow.com/a/17009756/219238

Note that the credentials will only be valid for 1 minute so the proper way to save data from your ObjectiveC client is to have it communicate with the meteor webserver instead of directly with mongodb. The simplest way to do this is to expose a REST endpoint using the iron-router package as outlined here: https://github.com/EventedMind/iron-router/#server-side-routing

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top