diff --git a/docs/queries/overview.mdx b/docs/queries/overview.mdx index 24d2c9bc0..bdfabad6e 100644 --- a/docs/queries/overview.mdx +++ b/docs/queries/overview.mdx @@ -194,7 +194,7 @@ const getPosts = async () => { ## Sort -Payload `find` queries support a `sort` parameter through all APIs. Pass the `name` of a top-level field to sort by that field in ascending order. Prefix the name of the field with a minus symbol ("-") to sort in descending order. +Payload `find` queries support a `sort` parameter through all APIs. Pass the `name` of a top-level field to sort by that field in ascending order. Prefix the name of the field with a minus symbol ("-") to sort in descending order. Because sorting is handled by the database, the field you wish to sort on must be stored in the database to work; not a [virtual field](https://payloadcms.com/blog/learn-how-virtual-fields-can-help-solve-common-cms-challenges). It is recommended to enable indexing for the fields where sorting is used. **REST example:** **`https://localhost:3000/api/posts?sort=-createdAt`**