Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4672

Comment on: "manual/reference/method/cursor.sort.txt" - conflicting statements

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • Server_Docs_20231030
    • None
    • manual

    Description

      Hi,

      Thanks for very concise and informative documentation on Mongodb.

      I found a conflicting statement on the use of combination of sort and limit with 'find' method. The page on sort says that we should limit the cursor size so that sorting is applied only on the limited set of data. But the page on find method states that find().sort().limit() will be treated in the same was as find().limit().sort() and limit() shall always be carried after find and sort operations. Which means that sorting cannot be carried out on limited set of found data.

      Can you please clear my doubt on this. I want to limit the data before applying sort on it as otherwise my application is crashing because of size of data in collection.

      Thanks,
      Mani

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 45 weeks, 5 days ago