-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid object ID #27
Comments
I added some tests for this, but I don't see an exception? What exception did you get? |
Hi, I got an MongoException Invalid Object ID, on The error happens when I do: MyMongoModel::where('_id',$someObjectID)->first(); I forced the error specifying a wrong Object ID, for example, the right Object ID is: 521b64a4fa4634aa068b456b and I pass 521b64a4fa4634aa068b45 (missing the last two characters). I expected to get a NULL or empty response. I'm using mongo v2.4.5 on a ubuntu 12.04 running with apache and php 5, on a Vagrant machine. Something due this config? Thanks! |
Are you using the latest version of this library? |
Yeap… just did a composer update right now to check and I'm with the last version. |
What is on line 512 in your version? Because I only have a closing bracket on that line. |
Don't know if it's a real issue or a feature needed, but there's some way to not throw an exception when a search doesn't find a object with the specified _id ?
Perhaps act like the mysql, returning an empty value if there isn't a object with the selected _id…
I'm doing this: MongoModel::where('_id',$data['_id'])->first();
The text was updated successfully, but these errors were encountered: