-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOCSP-35978: Insert multiple usage example #2849
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
DOCSP-35978: Insert multiple usage example #2849
Conversation
docs/usage-examples/insertMany.txt
Outdated
|
||
.. tip:: | ||
|
||
To learn more about insert operations, see the :ref:`laravel-fundamentals-insert-documents` section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: will merge after #2804
…idy/laravel-mongodb into DOCSP-35978-insert-multiple-usage
$result = Movie::insert([ | ||
[ | ||
'title' => 'Anatomy of a Fall', | ||
'year' => 2023, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add an example with a DateTime object, because casts
are not applied when Model::insert
is used. I think we've already discussed this with @ccho-mongodb in another PR, which I can't find.
'released_at' => new UTCDateTime(new DateTimeImmutable('2023-01-01'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you mention why we need to explicitly set the UTCDateTime? (because model casts are not applied).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + a couple small things. Nice job!
JIRA - https://jira.mongodb.org/browse/DOCSP-35978
Staging - https://preview-mongodbnorareidy.gatsbyjs.io/laravel/DOCSP-35978/usage-examples/insertMany/
Checklist