Local Meteor Packages, Mongo.setConnectionOptions & Mongo.setConnectionOptions is not a function error

My mongo instance with MLab keeps timing out. I tried setting options in the URI:


via docs

but Mlab is set to no WS timeout by default (I think) so I need to turn up the timeout on my meteor mongo driver. From what I’m reading in git issues and on the forum it seems the only way to configure this is with this newly added method on Mongo:

	  mongos: {
	    socketOptions: {
	      connectTimeoutMS: 300000,
	      socketTimeoutMS: 300000,

To configure that, you need it to have this code snippet load first. For it to load first you need to have it in a package that sits about any other packages using mongo (e.g. accounts-base). This knowledge comes from this thread:

I setup a local package but keep hitting this error:

Mongo.setConnectionOptions is not a function both local and on galaxy. I’m not familiar with meteor packages, so I’m hoping that I’m just importing Mongo wrong. I’m pretty sure my meteor version is all up to dat and that my package is listed after ‘meteor/mongo’ but before any packages that use it.

I have my local package setup as follows:


// Write your package code here!

// Variables exported by this module can be imported by other packages and
// applications. See mongo-connection-tests.js for an example of importing.
export const name = 'mongo-connection';

// Write your package code here!
import { Mongo } from 'meteor/mongo';

	  mongos: {
	    socketOptions: {
	      connectTimeoutMS: 300000,
	      socketTimeoutMS: 300000,


  name: 'mongo-connection',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: '',
  // URL to the Git repository containing the source code for this package.
  git: '',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'

Package.onUse(function(api) {
  api.use(['mongo', 'ecmascript']);

Package.onTest(function(api) {

then my .meteor packages file:

# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.0.4             # Packages every Meteor app needs to have
mobile-experience@1.0.4       # Packages for a great mobile UX
mongo@1.1.14                   # The database Meteor supports right now
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.1.1                 # Meteor's client-side reactive programming library

standard-minifier-css@1.3.2   # CSS minifier run for production mode
standard-minifier-js@1.2.1    # JS minifier run for production mode
es5-shim@4.6.15                # ECMAScript 5 compatibility for older browsers.
ecmascript@0.6.1              # Enable ECMAScript2015+ syntax in app code



mongo-connection.js:11 Uncaught TypeError: Mongo.setConnectionOptions is not a function
    at meteorInstall.node_modules.meteor.mongo-connection.mongo-connection.js (mongo-connection.js:11)
    at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
    at require (modules-runtime.js?hash=637cb12…:116)
    at mongo-connection.js?hash=f2fe1b1…:55
    at mongo-connection.js?hash=f2fe1b1…:61
meteorInstall.node_modules.meteor.mongo-connection.mongo-connection.js @ mongo-connection.js:11
fileEvaluate @ modules-runtime.js?hash=637cb12…:191
require @ modules-runtime.js?hash=637cb12…:116
(anonymous) @ mongo-connection.js?hash=f2fe1b1…:55
(anonymous) @ mongo-connection.js?hash=f2fe1b1…:61