I am not sure why you are expecting dashes in the _id
field - if they're auto generated by Mongo (i.e. you did not have a _id
field in your import), they'd look something like 4f5fbb91a717b0f8d080e9d7
. So, what you're seeing is perfectly normal result of a successful import with no user-defined _id
field.
That said, the _id
, when auto-generated, is an instance of ObjectId
and not a String
. This query will work:
db.assets.findOne({"_id": new ObjectId("51073797074f0d6db8e3149a")})