Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor without mongo

Tags:

mongodb

meteor

With 0.6.5 release it is possible to develop non web apps with meteor. I rebuild it from scratch for ARM processor but I don't want DB support at all. (Mongo is a processor killer, has to high footprint and I simply don't need it)

ARM should work as DDP client only, with this in mind I build it manually without mongo.

And tried to build simplest app possible only 1 package at start (all standard packages removed)

meteor

and one file in server folder

main = function(argv){
  return "DAEMON"
}

Meteor.setInterval(function(){
  console.log("HellOnWorld");
},1000);

On machine with full meteor install it works as expected but without mongo installed I got errors

Unexpected mongo exit code 127. Restarting.
Unexpected mongo exit code 127. Restarting.
Initializing mongo database... this may take a moment.
Unexpected mongo exit code 127. Restarting.
Can't start mongod

Obviously I don't have and want mongo.

Is there any way to start meteor without waiting for mongo db ?

Meteor team plans to support other db's so it must be implemented sooner or later.

like image 943
Elrot Avatar asked Aug 31 '13 07:08

Elrot


People also ask

What is Mongo meteor?

Meteor provides a complete open source platform for building web and mobile apps in pure JavaScript. The Meteor team chose MongoDB as its datastore for its performance, scalability, and rich features for JSON. Meteor apps run using JavaScript via Node. JS on the server and JavaScript in the phone's browser.

Does meteor use mongoose?

Meteor already talks to mongodb. But you can use mongoose. You might have an issue with a 10 second delay with reactivity. Also you won't be able to enjoy using it on the client.


2 Answers

UPDATE

For newer versions of Meteor you need to remove the mongo package. The mongo package is embedded in the meteor-platform package. So you need to remove that and add all the rest back (from https://github.com/meteor/meteor/tree/devel/packages/meteor-platform):

meteor remove meteor-platform
meteor add  meteor webapp logging tracker session ddp blaze spacebars templating check underscore jquery random ejson templating check underscore jquery random ejson

Then your app won't use Mongo anymore :).

In dev mode you can get rid of mongo by setting the MONGO_URL environment variable to something else and start meteor. For example: MONGO_URL=mongodb://nowhere meteor

like image 86
Tarang Avatar answered Oct 13 '22 16:10

Tarang


Turns out that if you just set any MONGO_URL environment variable before running meteor, it won't start its local MongoDB! Fantastic for testing packages that don't depend on Mongo.

Before:

$ meteor test-packages ./
Testing fortawesome:fontawesome-compat...
[[[[[ Tests ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/

After

$ MONGO_URL=mongodb://mysql.com meteor test-packages ./  # haha
Testing fortawesome:fontawesome-compat...
[[[[[ Tests ]]]]]

=> Started proxy.
=> Started your app.

=> App running at: http://localhost:3000/

Look ma, no Mongo!

I have confirmed that no mongo process is started, and no .meteor/local/db folder is created.

like image 9
Dan Dascalescu Avatar answered Oct 13 '22 16:10

Dan Dascalescu