diff --git a/nmdc_runtime/api/endpoints/nmdcschema.py b/nmdc_runtime/api/endpoints/nmdcschema.py index a4a04140..180ba544 100644 --- a/nmdc_runtime/api/endpoints/nmdcschema.py +++ b/nmdc_runtime/api/endpoints/nmdcschema.py @@ -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