Skip to content

Commit c5be4de

Browse files
committed
Merge pull request #73 from codeforboston/update_mongo
update to work with Mongo 2.6
2 parents 4756456 + d43ce48 commit c5be4de

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

files/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ To ensure geo indexes on location fields run:
2121
(this should be a one time operation after creating the db)
2222

2323
To query for all locations within 10000000 meters of <40,-71>, ordered by proximity run:
24-
db.pantries.find({"loc":{ $near:{$geometry:{type:"Point",coordinates:[-71.0,40.0]}}, $maxDistance:10000000}})
24+
db.pantries.find({"loc":{ $near:{$geometry:{type:"Point",coordinates:[-71.0,40.0]}, $maxDistance:10000000}}})

lib/routes/search.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function(app) {
1414

1515
var search = function(lat, lng, radius) {
1616
radius || (radius = Infinity); // default radius of Infinity to include everything
17-
Pantry.find({loc: {$near: {$geometry: {type: "Point", coordinates: [lng,lat]}}, $maxDistance: radius}}, function(err, pantries) {
17+
Pantry.find({loc: {$near: {$geometry: {type: "Point", coordinates: [lng,lat]}, $maxDistance: radius}}}, function(err, pantries) {
1818
if (err != null || pantries == null) {
1919
console.log("unable to find results", err, pantries);
2020
res.send('unable to find any pantries', 404);
@@ -46,4 +46,3 @@ module.exports = function(app) {
4646
});
4747

4848
}
49-

0 commit comments

Comments
 (0)