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

Query page has minor error

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 01112017-cleanup
    • Affects Version/s: mongodb-3.2
    • Component/s: manual, primer
    • Labels:
      None

      Page: https://docs.mongodb.org/getting-started/python/query/

      Zipcode is sorted in DESCENDING order but description notes that it sorts in ASCENDING order.

      To sort by multiple keys, pass a list of keys and sort type pairs. For example, the following operation returns all documents in the restaurants collection, sorted first by the borough field in ascending order, and then, within each borough, by the "address.zipcode" field in ascending order:

      import pymongo
      cursor = db.restaurants.find().sort([
      ("borough", pymongo.ASCENDING),
      ("address.zipcode", pymongo.DESCENDING)
      ])

            Assignee:
            Unassigned Unassigned
            Reporter:
            need.pymongo.help Need Py Mongo Help
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              8 years, 12 weeks, 1 day ago