Fix logic for missing geo index error message check (#1824)

This commit is contained in:
Tyler Brock
2016-05-18 12:33:55 -07:00
parent 8c09c3dae1
commit d7d4699832

View File

@@ -17,7 +17,7 @@ export default class MongoCollection {
return this._rawFind(query, { skip, limit, sort })
.catch(error => {
// Check for "no geoindex" error
if (error.code != 17007 || !error.message.match(/unable to find index for .geoNear/)) {
if (error.code != 17007 && !error.message.match(/unable to find index for .geoNear/)) {
throw error;
}
// Figure out what key needs an index