Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Compass
Created by Guest
Created on Dec 3, 2021

Be able to sort document fields alphabetically

It would be useful to be able to display columns for fields in a document in alphabetical order
  • Attach files
  • Guest
    Nov 25, 2024
    Exactly what Oz says. I have some documents with 500 fields. If I want to find a specific one and edit it, I have to do a linear search through those 500 fields.
  • Guest
    Nov 24, 2024
    Betsy (and Marc) - The suggestion is to be able to sort the FIELDS, not the documents/results. The fields in a document are shown by the order they were inserted to the object which makes spotting fields difficult with documents that has a lot of them (especially when the order has no real meaning or additional fields are added later). Be able to show the document with the fields in alphabetical order will make it easier to use.
  • Guest
    Nov 22, 2024
    Hi, Marc is correct. It is possible to sort query results in alphabetical order based on a field of your choice by expanding the query options. Here is a link to our documentation on sorting in Compass: https://www.mongodb.com/docs/compass/current/query/sort/ For example, if you'd like to sort the results in alphabetical order based on a field "name", you could enter {"name": 1} as your sort. It is not currently possible to sort documents in the table view by clicking a button while viewing the document output. However, I'm curious if modifying and re-running the query is enough?
  • Guest
    Nov 22, 2024
    You can sort the result in the query options
  • Guest
    Dec 11, 2023
    Comparing docs from a query result with more than 2 fields per doc is not easy as the fields show in an apparently arbitrary position in each doc.
  • Guest
    Sep 17, 2022
    Hello, We have a lot of fields in a record, like 80. It can be difficult to find a specific field when there are that many. So, it would be helpful if you could provide an option to sort the fields in alphabetical order. Thank you.
  • Guest
    Dec 20, 2021
    I desperately need this functionality, we have objects with a lot of fields and it's a real pain to find a specific field in each one. Would appreciate it greatly, cheers!