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

Comment on: "manual/core/index-single.txt"

    XMLWordPrintableJSON

Details

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

    Description

      If I do this:
      db.records.insert({
      "_id": ObjectId("570c04a4ad233577f97dc459"),
      "score": 1034,
      "location":

      { state: "NY", city: "New York" }

      })
      after this step is done, I do this to create an index:
      db.records.createIndex(

      { "location.state": 1 }

      )

      now when I query this collection, I find this command cannot find any document:
      db.records.find( { location:

      { city: "New York", state: "NY" }

      } )
      but, this command can do it:
      db.records.find( { location:

      { state: "NY", city: "New York" }

      } )

      Attachments

        Activity

          People

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

            Dates

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