rafaelmaeuer
10/9/2017 - 1:38 PM

how do I search for an object by its ObjectId in the console? - From https://stackoverflow.com/questions/8233014/how-do-i-search-for-an-obje

how do I search for an object by its ObjectId in the console? - From https://stackoverflow.com/questions/8233014/how-do-i-search-for-an-object-by-its-objectid-in-the-console

var ObjectId = require('mongodb').ObjectId; 
var id = req.params.gonderi_id;       
var o_id = new ObjectId(id);
db.test.find({_id:o_id})