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

meta projections can project into illegal fields

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • ALL

    Description

      Currently one can use the meta projections to put fill fields that would normally be invalid. Though they are valid json results, we probably should avoid letting users create documents using mongo, that they cannot then save in mongo.

      > db.test.ensureIndex({a:"text"})
      > db.test.insert({a: "test text"})
      SingleWriteResult({
              "writeErrors" : [ ],
              "writeConcernErrors" : [ ],
              "nInserted" : 1,
              "nUpserted" : 0,
              "nUpdated" : 0,
              "nModified" : 0,
              "nRemoved" : 0,
              "upserted" : [ ]
      })
      > db.test.find({$text: {$search: "text"}}, {$query: {$meta: "textScore"}})
      { "_id" : ObjectId("52d4351004b77493319064a3"), "a" : "test text", "$query" : 0.75 }

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrew.emil@10gen.com Andrew Emil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: