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

Comment on: "manual/reference/method.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • None
    • None

    Description

      I have a collection such as:-

      { "_id" : ObjectId("56c2a7320efba7c30cdb139b"), "country_code" : "US", "country_name" : "United States", "region_name" : "Hawaii", "city_name" : "'Aiea", "time_zone" : "-10:00\"\r" }

      Am doing, db.collection.distinct("countries_name") to get the distinct country_names. Now i want to sort them , but sort is not applicable on distinct.
      Error :-TypeError: db.countries_cities.distinct("country_name").sort(

      {country_name:1}

      ) is not a function (shell):1

      Attachments

        Activity

          People

            Unassigned Unassigned
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 51 weeks, 6 days ago