Skip to content
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

::all() returns "_id":{"$id":"51c33c7e537e07abac000004"} #2

Closed
mrusme opened this issue Jun 22, 2013 · 3 comments
Closed

::all() returns "_id":{"$id":"51c33c7e537e07abac000004"} #2

mrusme opened this issue Jun 22, 2013 · 3 comments

Comments

@mrusme
Copy link

mrusme commented Jun 22, 2013

Hi,

since the last composer update, the ::all() method seems to return a broken _id. Here's an example code:

public function index()
{
$threads = Thread::all();

return Response::json($threads);
}

The code is resulting in this:

[{"_id":{"$id":"51c33c7e537e07abac000004"},"updated_at":{"sec":1371749502,"usec":0},"created_at":{"sec":1371749502,"usec":0}}]

It appears to have something to do with how the actual _id from the MongoDB is being processed.

@jenssegers
Copy link
Contributor

I think this is the same behaviour as before, it is the MongoID object. I might take a look on how I can convert the MongoID object to string when it is used like this.

@jenssegers
Copy link
Contributor

If more people would like to see the _id MongoID object converted to a string, please let me know.

@jenssegers
Copy link
Contributor

I updated the code to hide the MongoId and MongoDate object from the user.

kargnas added a commit to opgginc/laravel-mongodb that referenced this issue Nov 14, 2017
alcaeus added a commit to alcaeus/laravel-mongodb that referenced this issue Aug 16, 2023
* Skip MySQL tests if database is not available

* Introduce tests namespace
alcaeus added a commit that referenced this issue Aug 22, 2023
* Skip MySQL tests if database is not available

* Introduce tests namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants