I have a collection with an ID (_ID).
{
"_id": ObjectId("5583df9da55f654609901eed"),
"group": "Tomorrowland",
"description": "Délire 2015 à Tomorrowland",
"uid": [
"5583df21a55f654609901eec",
"5583e8ef9aeb31390bb50bf6"
],
"pictures": [
"1434705960113.jpg",
"1434705974710.jpg",
"1434706147177.jpg",
"1434711007201.jpg"
],
"__v": 0
}
If a make a query (FindByID) and I check for the ID 1 i get an error (all work fine in this case : the id not exist)
Now if i make the same query and I check for the ID (5582a7f12686cf776a0daee5), I get no error ... but the ID doen't exist in my collection !
How is it possible ?
Here is the code :
groupid = req.headers['groupid'];
Cloud.findById(groupid).exec(function(err, data)
{
if(err){
res.status(404);
res.json('group not found');
}
else
{
// Do Stuff
}
});