-
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
DOCSP-38327: add Query Builder examples to usage examples #3259
base: 4.8
Are you sure you want to change the base?
Conversation
e877a17
to
111b290
Compare
9fa735d
to
f498f97
Compare
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.
A couple real small things but LGTM!
docs/usage-examples/insertMany.txt
Outdated
- Inserts documents into the ``movies`` collection | ||
- Prints whether the insert operation succeeds | ||
|
||
The example calls the ``insert()`` method to insert documents that model |
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.
"model" here confused me here for a minute, I think because I was thinking "a model object" based on the previous bullets
The example calls the ``insert()`` method to insert documents that model | |
The example calls the ``insert()`` method to insert documents that represent |
docs/usage-examples/insertMany.txt
Outdated
- Inserts documents into the ``movies`` collection | ||
- Prints whether the insert operation succeeds | ||
|
||
The example calls the ``insert()`` method to insert documents that model |
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.
The example calls the ``insert()`` method to insert documents that model | |
The example calls the ``insert()`` method to insert documents that represent |
docs/usage-examples/updateOne.txt
Outdated
- ``where()``: Matches documents in which the value of the | ||
``title`` field is ``"Carol"`` | ||
- ``orderBy()``: Sorts matched documents by their ascending ``_id`` values | ||
- ``first()``: Retrieves only the first matching document. |
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.
- ``first()``: Retrieves only the first matching document. | |
- ``first()``: Retrieves only the first matching document |
$movies = Movie::where('runtime', '>', 900) | ||
->orderBy('_id') | ||
->get(); | ||
// end-find | ||
// end-eloquent-find |
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 must keep the previous assertion, otherwise your query is not tested.
// end-eloquent-find | |
// end-eloquent-find | |
$this->assertEquals(2, $movies->count()); |
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.
I'll go through an re-add the tests where I missed them!
c047dec
to
e6136c7
Compare
https://jira.mongodb.org/browse/DOCSP-38327
adds query builder code examples to usage examples
STAGING - click through each usage example that was changed
Checklist