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

DOCSP-43074: Specify a Query #30

Merged
merged 7 commits into from
Sep 16, 2024

Conversation

mcmorisi
Copy link
Collaborator

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-43074
Staging - https://preview-mongodbmcmorisi.gatsbyjs.io/c/DOCSP-43074-specify-query/read/specify-a-query/

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link
Collaborator

@rustagir rustagir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the content looks good but inquiring about the sample data used. I can take another look once you respond and/or make adjustments!

Comment on lines 25 to 26
You can refine the set of documents that a query returns by creating a
**query filter**. A query filter is an expression that specifies the search
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can refine the set of documents that a query returns by creating a
**query filter**. A query filter is an expression that specifies the search
You can define a **query filter** to retrieve specific documents from a collection
when performing a query. A query filter is an expression that specifies the search

Comment on lines 28 to 30
In a query filter, you can prompt the driver to search for documents with an
exact match to your query, or you can compose query filters to express more
complex matching criteria.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In a query filter, you can prompt the driver to search for documents with an
exact match to your query, or you can compose query filters to express more
complex matching criteria.
By defining a query filter, you can direct the driver to search for documents with an
exact match to your query, or you can compose query filters to express more
complex matching criteria.

Comment on lines 32 to 53
Sample Data
~~~~~~~~~~~

The examples in this guide run operations on a collection called
``fruits`` that contains the following documents:

.. code-block:: json

{ "_id": 1, "name": "apples", "quantity": 5, "rating": 3, "color": "red", "type": ["fuji", "honeycrisp"] },
{ "_id": 2, "name": "bananas", "quantity": 7, "rating": 4, "color": "yellow", "type": ["cavendish"] },
{ "_id": 3, "name": "oranges", "quantity": 6, "rating": 2, "type": ["naval", "mandarin"] },
{ "_id": 4, "name": "pineapple", "quantity": 3, "rating": 5, "color": "yellow" },

The following code example shows how to create a database and collection, then
insert the sample documents into your collection:

.. literalinclude:: /includes/read/specify-a-query.c
:start-after: start-sample-data
:end-before: end-sample-data
:language: c
:dedent:
:copyable:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Should we follow convention used in other pages/standardizations to use the Atlas sample data when possible instead of using generated data?

Copy link
Collaborator Author

@mcmorisi mcmorisi Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can change to the restaurants collection.

EDIT: will use movies instead

@mcmorisi mcmorisi requested a review from rustagir September 12, 2024 20:32
Copy link
Collaborator

@rustagir rustagir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small improvements, but approving! Can take another look if needed.

.. TODO
.. For more information about
.. creating a query filter, see :ref:`c-specify-query`.
For more information about creating a query filter, see :ref:`c-specify-query`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For more information about creating a query filter, see :ref:`c-specify-query`.
To learn more about creating query filters, see :ref:`c-specify-query`.

.. output::
:visible: false

{ "_id" : { "$oid" : "..." }, "title" : "Wild and Woolly", "type" : "movie", ... }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S: can truncate these results further

Suggested change
{ "_id" : { "$oid" : "..." }, "title" : "Wild and Woolly", "type" : "movie", ... }
{ "_id" : ..., "title" : "Wild and Woolly", "type" : "movie", ... }

Comment on lines 81 to 82
parameter to the ``mongoc_collection_find_with_opts()`` function. The code returns all documents with a
``year`` field value greater than ``2015``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
parameter to the ``mongoc_collection_find_with_opts()`` function. The code returns all documents with a
``year`` field value greater than ``2015``.
parameter to the ``mongoc_collection_find_with_opts()`` function. The code returns all documents in which
the value of the ``year`` field is greater than ``2015``.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this phrasing where applicable

Comment on lines 249 to 250
To learn more about retrieving documents with the {+driver-short+}, see
:ref:`c-retrieve`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S: avoid "with"

Suggested change
To learn more about retrieving documents with the {+driver-short+}, see
:ref:`c-retrieve`.
To learn more about using the driver to retrieve documents, see
:ref:`c-retrieve`.

@mcmorisi mcmorisi requested a review from kevinAlbs September 16, 2024 13:59
Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for docs-c ready!

Name Link
🔨 Latest commit 63af7ae
🔍 Latest deploy log https://app.netlify.com/sites/docs-c/deploys/66e8399fbb1aad00087e3425
😎 Deploy Preview https://deploy-preview-30--docs-c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mcmorisi mcmorisi merged commit 3aefd14 into mongodb:standardization Sep 16, 2024
6 checks passed
@mcmorisi mcmorisi deleted the DOCSP-43074-specify-query branch September 16, 2024 17:14
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

Successfully merging this pull request may close these issues.

3 participants