Skip to content

Commit

Permalink
Further revise endpoint description to make more natural sounding
Browse files Browse the repository at this point in the history
  • Loading branch information
eecavanna committed Nov 30, 2024
1 parent b7a47d9 commit 9c13971
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nmdc_runtime/api/endpoints/nmdcschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ def list_from_collection(
You can get all the valid collection names from the [Database class](https://microbiomedata.github.io/nmdc-schema/Database/)
page of the NMDC Schema documentation.
Note: If the specified maximum page size is a non-zero number and the specified collection contains _more than that
number_ of resources that match the filter criteria, this endpoint will paginate the resources. Pagination
can take a long time—especially for collections having many documents.
Note: If the specified maximum page size is a number greater than zero, and _more than that number of resources_
in the collection match the filter criteria, this endpoint will paginate the resources. Pagination can take
a long time—especially for collections that contain a lot of documents (e.g. millions).
**Tips:**
1. When the filter includes a regex and you are using that regex to match the beginning of a string, try to use a
regex that is a "[prefix expression](https://www.mongodb.com/docs/manual/reference/operator/query/regex/#index-use)."
1. When the filter includes a regex and you're using that regex to match the beginning of a string, try to ensure
the regex is a [prefix expression](https://www.mongodb.com/docs/manual/reference/operator/query/regex/#index-use),
That will allow MongoDB to optimize the way it uses the regex, making this API endpoint be faster.
"""
# TODO: The note about collection names above is currently accurate, but will not necessarily be accurate, since the
# `Database` class could eventually have slots that aren't `multivalued` and `inlined_as_list`, which are
Expand Down

0 comments on commit 9c13971

Please sign in to comment.