Starting Meteor with MongoDB on Windows 64-bit

Mary Bantigue
3 min readMay 27, 2017

--

I was trying out the Meteor tutorial for the Simple Todo app and found that I got stuck with Step 3: Collections. What I needed to do, according to the steps listed, was to run meteor mongo (or meteor.bat mongo on my case) on a separate terminal from my meteor server. However, I got this error trying to do that.

MongoDB shell version: 3.2.12
connecting to: 127.0.0.1:3001/meteor
Server has startup warnings:
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten]
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten] ** WARNING: This 32-bit MongoDB binary is deprecated
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten] ** NOTE: This is a 32-bit MongoDB binary running on a 64-bit operating
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten] ** system. Switch to a 64-bit build of MongoDB to
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten] ** support larger databases.
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten]
2017–05–27T12:12:40.508+0800 I CONTROL [initandlisten]
2017–05–27T12:12:40.509+0800 I CONTROL [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2017–05–27T12:12:40.509+0800 I CONTROL [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with — journal).
2017–05–27T12:12:40.509+0800 I CONTROL [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
2017–05–27T12:12:40.509+0800 I CONTROL [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2017–05–27T12:12:40.509+0800 I CONTROL [initandlisten]
bye

As a programmer I googled (of course) about this error and found tiny bits and pieces of the idea of what I should be doing in order for this to work on my windows 64-bit machine. After some digging, these are the steps that I’ve done in order to finally get the thing running.

  1. Install MongoDB
  2. Create the directory c:\data\db
  3. Add mongod to the Environment Variables (so I could simple type mongod and mongo on the terminal later on and not the full path for the mongo executable). The path should be something like: C:\Program Files\MongoDB\Server\3.4\bin
  4. Run mongod on the terminal and see it work
  5. On a separate terminal, go to your meteor app directory and type the following (*note: simple-todos is the db name):
    $ MONGO_URL=mongodb://localhost:27017/simple-todos meteor.bat
    This runs meteor (and don’t be surprised to see if there is no longer a text saying started mongoDB because that is already running from step 4 earlier)
  6. Then on a third terminal just type:
    $ mongo
    *note: When running meteor.bat mongo, it would say that this only applies to the local MongoDB server. That’s why you just have to run mongo the old fashioned way.

And that’s it! Your mongo is running and you can proceed on creating that collection:

$ mongo
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.4
show dbs
admin 0.000GB
local 0.000GB
use simple-todos
switched to db simple-todos
db.tasks.insert({ text: “Hello world!”, createdAt: new Date() });
WriteResult({ “nInserted” : 1 })

I hope this helps windows users who’re starting out on meteor and got stuck on this problem as well. Happy coding and cheers to getting out of the stuck-zone!

--

--