Skip to content

Instantly share code, notes, and snippets.

@RobAWilkinson
Last active April 24, 2016 04:20
Show Gist options
  • Save RobAWilkinson/8482c5710bf8c87d4a2f5b9303ca4bb1 to your computer and use it in GitHub Desktop.
Save RobAWilkinson/8482c5710bf8c87d4a2f5b9303ca4bb1 to your computer and use it in GitHub Desktop.
mongoose.models.Users.collection.findOne({_id: ObjectId(req.user.middleName)}, function(err, loggedin) {
mongoose.models.Users.find({
location: { $near: { $geometry: loggedin.location } },
}, function(err, users) => {
return res.json(users);
});
});
})
{
"_id" : ObjectId("571ad2871f34572a11cc001f"),
"createdAt" : ISODate("2016-04-23T01:40:23.718Z"),
"updatedAt" : ISODate("2016-04-23T01:46:53.932Z"),
"email" : "[email protected]",
"address" : "address",
"address2" : "address2",
"city" : "City",
"state" : "CA",
"zip" : "91709",
"phone" : "111111111",
"age" : 27,
"how_many" : 2,
"child_gender" : "BOTH",
"travel_range" : 10,
"biography" : "brief bio",
"recent_babysitting_experience" : "recent experience",
"other_related_work" : "child related work",
"favorite_activities" : "favorite activites",
"certifications" : "certifications",
"medical_conditions" : "medical conditions",
"cooking_level" : "comfort level on cooking",
"education" : "Some College",
"marital_status" : "Married",
"child_age_ranges" : " age range of kids",
"crime_description" : "crime convicted",
"sitter" : true,
"gender" : "M",
"has_pets" : true,
"special_needs" : true,
"adhd" : true,
"allergies" : true,
"cook" : true,
"autism" : true,
"employed" : true,
"have_children" : true,
"criminal" : true,
"driving_infractions" : true,
"transportation" : true,
"cleaning" : true,
"bathing_bedtime" : true,
"time_out" : true,
"report_id" : "b71331f8-2bfd-4d97-9dad-3671d28b8cec",
"profile_change_approved" : false,
"report_status" : [ ],
"transactions" : [ ],
"cards" : [ ],
"reviews" : [ ],
"unavailable" : [
ISODate("2016-04-21T00:00:00Z"),
ISODate("2016-04-20T00:00:00Z")
],
"favorite_sitters" : [ ],
"active" : false,
"pets" : [ ],
"location" : {
"type" : "Point",
"coordinates" : [
-122.4797394,
37.721513
]
},
"age_groups" : [
"4-7",
"8-11",
"12+"
],
"__v" : 2,
"href" : "https://api.stormpath.com/v1/accounts/2iz8xGpIGyd2JINQ7MoFZA",
"last_approved_time" : ISODate("2016-04-23T01:40:46.803Z")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment