Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12238

Projecting {$meta: "textScore"} over existing fields creates a duplicate key

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.4
    • Component/s: Querying, Text Search
    • Labels:
    • ALL
    • Hide
      > db.test.find(
          { $text: { $search: "dog" } },
          { _id: { $meta: "textScore" } }
      )
      {
        "_id": 2,
        "words": "dog cat",
        "_id": 2
      }
      
      Show
      > db.test.find( { $text: { $search: "dog" } }, { _id: { $meta: "textScore" } } ) { "_id" : 2, "words" : "dog cat" , "_id" : 2 }

      When projecting the {$meta: "textScore"} field over _id the resulting documents contain two _id fields which is impossible in javascript as keys in objects must be unique. Something is wrong here.

            Assignee:
            rassi J Rassi
            Reporter:
            tyler@10gen.com Tyler Brock
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: