8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi!
First thank you for the amazing work!
When getting a post, for example, I get the entire object, like:
post
$post = Post::find('52827b589a1ef3c65c0041a7'); echo $post->title;
But when I have comments "inside" posts - not using hasMany - I got the comments as array and not object:
$comments = $post->comments; foreach ($comments as $comment) { echo $comment['author']; // will be better $comment->author }
Does the library have some "config" to ensure returning "object" as default?
Thank you so much!
The text was updated successfully, but these errors were encountered:
The native MongoDB PHP driver always returns data as an array. It does not have something like PDO::FETCH_OBJ, so there is not much I can do about it.
PDO::FETCH_OBJ
Sorry, something went wrong.
Sure! Actually I'm doing something like:
$comment = (object) $comment; echo $comment->author;
So maybe an option to retrieve them like FETCH_OBJ will be a good idea.
FETCH_OBJ
No problem! Thank you.
No branches or pull requests
Hi!
First thank you for the amazing work!
When getting a
post
, for example, I get the entire object, like:But when I have comments "inside" posts - not using hasMany - I got the comments as array and not object:
Does the library have some "config" to ensure returning "object" as default?
Thank you so much!
The text was updated successfully, but these errors were encountered: