Meteor.com mongodb version

Good afternoon

has anything changed with the version of mongodb used when deploying to meteor.com? I suddenly get an exception for a $near query that used to work, and still does work on my local deployment

exception: can't find any special indices: 2d (needs index), 2dsphere (needs index),  for:  {
    $and: [{
        $or: [{
            generic.active: true
        }, {
            userId: "6fjRPR2X3buBkirMy"
        }]
    }, {
        generic.location.point: {
            $near: {
                $geometry: {
                    type: "Point",
                    coordinates: [-2.134466179521586, 0.6548036874414745]
                },
                $maxDistance: 700,
                $minDistance: 1
            }
        }, businessType: {
            $in: ["Restaurant"]
        }
    }]
}

but my collection does have an index defined

production-a:PRIMARY> db.business.getIndexes()
[
	{
		"v" : 1,
		"name" : "_id_",
		"key" : {
			"_id" : 1
		},
		"ns" : "domain.business"
	},
	{
		"v" : 1,
		"name" : "generic.location.point_2dsphere",
		"key" : {
			"generic.location.point" : "2dsphere"
		},
		"ns" : "domain.business"
	}
]

OK, I just noticed when I run on my local system the mongo version is

connecting to: 127.0.0.1:3001/meteor
meteor:PRIMARY> db.version()
2.6.7

and the meteor.com deployed app

connecting to: production-db-a2.meteor.io:27017/domain
production-a:PRIMARY> db.version()
2.4.10

and I was able to narrow down the error some more. The fact that I $and several conditions in the query throws off 2.4.10. If I only query $near it works.

Any workaround for this?

As a workaround I separated out the $geometry query

Meteor.subscribe('collection', query, geo);

and handle it in the publish function like so

Meteor.publish('collection', function(query,geoquery) {
 var geoids=[];
 if(geoquery)
 {
  Collection.find({'generic.location.point': geoquery}).forEach(function(b){
   geoids.push(b._id);
  });
  if(geoids.length>=0)
  {
    query = {'$and': [ {_id: {$in: geoids}}, query ]};
  }
 }
 return Collection.find( query );
}

@jamgold

I’m also having a difficult bug where one query returns ‘undefined’ on the server but is fine on local/dev. Do you have any more ideas about how to debug this?