1.9.4 (2023-06-16)
Bug Fixes
- incorrectly return totalDocs=1 instead of the correct count when pagination=false (2e73938)
Tag Name: v1.9.4
Release Date: 6/16/2023
Payload CMSPayload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.
This patch release fixes an important bug where totalDocs was incorrectly returned as 1 when using pagination: false in query operations. Now, the correct document count is returned, ensuring accurate results when pagination is disabled. This is particularly important for developers who rely on document counts for their application logic while using non-paginated queries.
totalDocs was always returned as 1 when using pagination: falseNo migration is required for this patch release. The fix is automatically applied when upgrading to v1.9.4.
If you've implemented any workarounds in your code to handle the incorrect totalDocs count when using pagination: false, you can now safely remove those workarounds.
This upgrade is recommended for all users who:
pagination: false in their queriestotalDocs count in their application logicThe patch is small and focused, making it a low-risk upgrade from v1.9.3. There are no breaking changes or special upgrade steps required.
totalDocs count with disabled paginationThis release addresses a significant bug where queries with pagination: false would always return totalDocs: 1 regardless of the actual number of documents matching the query. The fix ensures that:
totalDocs property now correctly reflects the total number of documents that match the query criteriapayload.find() method with pagination: falseThis bug was identified and fixed in PR #2791.
No new features were added in this patch release.
No security fixes were included in this release.
While this release primarily focuses on bug fixes, the correction of the totalDocs count may indirectly improve performance for applications that were implementing workarounds for the incorrect counting behavior. By providing accurate counts directly, applications no longer need to perform additional queries to determine the correct document count.
This patch release fixes a specific but important bug in Payload CMS's query functionality. The impact is primarily on data accuracy rather than functionality or performance.
Before this fix, any query using pagination: false would incorrectly report totalDocs as 1, regardless of how many documents actually matched the query. This could lead to incorrect application behavior if your code relied on this count for pagination controls, data processing logic, or reporting.
The fix ensures that totalDocs accurately reflects the actual number of documents matching your query criteria, even when pagination is disabled. This improves the reliability of applications built with Payload CMS, especially those that need accurate document counts while retrieving all matching documents in a single query.
The change is backward compatible and requires no code changes in your application.