Can't Search By ObjectId #67

Open
whobutsb opened this Issue Nov 23, 2011 · 4 comments

Projects

None yet

4 participants

@whobutsb

Hello!

Whenever I try to search by ObjectId in the find command I get the error: 'Failure parsing JSON string near: _id : Obje' the rest is truncated by the window. I was wondering if there was going to be an update soon to fix this. Below is what i'm entering into the find input box:

{_id : ObjectId('4ecd3613cf72ab053100000a') }

@unfo
unfo commented Dec 20, 2011

I got this working on 2.3.2[73] out of the box.

@whobutsb

I found out that you needed to wrap the ID in double quotes in order for it query.

{_id : ObjectId("4ecd3613cf72ab053100000a") }

@stickfigure

Doesn't work for me, even with doublequotes. v2.5.4[98] on a mac.

@sogko
sogko commented Jan 23, 2014

Update: I made a mistake, i was using the release from fotonauts fork


I'm facing the same issue (Mac, v2.5.15)

I have the following document and wanted to get it by 'user' objectId

{
  "__v": 0,
  "_id": { "$oid" : "52e014261cbaadc0dd9e2c05" },
  "content": "test",
  "created": { "$date": 1390416934624 },
  "title": "tetetetet",
  "user": { "$oid" : "52e0140c1cbaadc0dd9e2c04" }
}

I tried the following and none of them worked

{"user": ObjectId("52e0140c1cbaadc0dd9e2c04")}

{"user": "52e0140c1cbaadc0dd9e2c04"}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment