Skip to content

docs: add note about non-deterministic sort order in collections #11908

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

Merged
merged 3 commits into from
Jun 23, 2025

Conversation

davidumoru
Copy link
Contributor

Description (required)

Added a note to the “Querying Collections” section of the Content Collections guide, explaining that the order of entries returned by getCollection() is non-deterministic and platform-dependent. This helps users understand that they should sort the results themselves if they need a specific order.

Related issues & labels (optional)

Copy link

netlify bot commented Jun 19, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 38d4b5b
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/68598b825a699400081879e1
😎 Deploy Preview https://deploy-preview-11908--astro-docs-2.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 project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jun 19, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/content-collections.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Hi @davidumoru! I was sure we had already written about this! Turns out, it's in the Upgrade to v5/from legacy collections guidance, but not here on this page. 😅

Thank you for adding this helpful information in a place where more people will find it, and you'll find my suggestions below for making it fit within the flow of this new location!

@sarah11918 sarah11918 added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label Jun 19, 2025
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
@davidumoru
Copy link
Contributor Author

Thanks for the suggestions, just committed them. This version reads much better.

@sarah11918 sarah11918 added the Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! label Jun 19, 2025
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thank you so much, this is a fantastic addition to this page and will help a lot of people! We appreciate you taking the time to contribute, and are happy to welcome you to Team Docs! 🥳

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@yanthomasdev yanthomasdev merged commit a6a6ce1 into withastro:main Jun 23, 2025
10 checks passed
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain that output order is not reliable when using getCollection
4 participants