Has anyone tried running Meteor with MongoDB 3.4?

I see MongoDB 3.4 has very useful new aggregation feature. Has anyone upgraded to 3.4?

https://docs.mongodb.com/master/release-notes/3.4/#aggregation

4 Likes

Nice! I also see collation and case-insensitive indexes. Finally!

How would I go about using MongoDB3.4 when running Meteor in development mode? (i.e. just running meteor in the terminal)

I would like to use the $in operator in the $project / $filter part of my aggregation pipeline, which is only supported for 3.4.

For now you will need to install and run MongoDB separately (which is straightforward).

https://docs.mongodb.com/manual/administration/install-community/

If you also want to use oplog, you will need to configure replication (not so straightforward, but not essential).

https://docs.mongodb.com/manual/replication/

Once you have MongoDB installed and running, you will need to set the MONGO_URL environment variable before running Meteor. The default MongoDB port is 27017, so this would look something like:

export MONGO_URL=mongodb://localhost:27017/meteor

where meteor is the database to use (can be anything).

If using oplog, you will also need to set MONGO_OPLOG_URL similarly.

3 Likes

i’m running 3.4 for development and in production with meteor since January now, and I must say the new aggregation features is totally worth the upgrade. Did not have any issues upgrading. Using meteorhacks:aggregate for aggregations.

3 Likes

Hi folks, I ran into an issue getting values from 3.4 to display. Opened another topic, linked below, but wanted to share it here in case any of the experts here assembled might know a solution… :slight_smile:

i think we can override meteor mongo, if we know where its installed path.

Hey @mrmsupport,

Can you be specific on how are you running meteor with MongoDB 3.4 in development and production?

Thanks
Sai

@saig
Meteor currently comes with MongoDB 3.6:

On a Meteor 1.7 project:

$ meteor mongo
MongoDB shell version v3.6.4
connecting to: mongodb://127.0.0.1:3001/meteor
MongoDB server version: 3.6.4
meteor:PRIMARY> 

No need to run it separately.

And just a note about forum etiquette: Please don’t bump old threads about the same question. It will notify everyone on the thread and is considered rude to do so. Especially avoid bumping multiple threads with the same question.

1 Like

mongo: Meteor isn’t running a local MongoDB server.

This command only works while Meteor is running your application locally. Start your application first with ‘meteor’ and then run this command in a new terminal. This error will also occur if you asked Meteor to use a different

MongoDB server with $MONGO_URL when you ran your application.

If you’re trying to connect to the database of an app you deployed with ‘meteor deploy’, specify your site’s name as an argument to this command.

First start your appllication on one tab of your terminal with “meteor”, then open a second tab and run “meteor mongo”

Hey @ivo,

Thats what i did exactly