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

Oplog format for $set operations on subdocuments creates format that is not queryable

    • Query Optimization
    • ALL
    • Hide

      Create initial document:

      use test
      db.tmp.update({ a: 1 }, { $set: { 'b.d': 4 } }, { upsert: true })
      

      Run same statement again to create an update in the oplog:

      db.tmp.update({ a: 1 }, { $set: { 'b.d': 4 } }, { upsert: true })
      

      Query for the oplog entry:

      db.oplog.rs.find({ "ns" : "test.tmp" })
      
      Show
      Create initial document: use test db.tmp.update({ a: 1 }, { $set: { 'b.d': 4 } }, { upsert: true }) Run same statement again to create an update in the oplog: db.tmp.update({ a: 1 }, { $set: { 'b.d': 4 } }, { upsert: true }) Query for the oplog entry: db.oplog.rs.find({ "ns" : "test.tmp" })

      When updating a document that uses a subdocument reference for the find parameters, an oplog entry is created that cannot be queried for specifically because the syntax of the document does not allow dots to be entered into keys for a document--for any normal inserts into collections.

      See the full context with some tests in the discussion here:

      http://stackoverflow.com/questions/30907116/mongodb-oplog-has-records-with-dots-in-key-names-which-cant-be-queried-for-af

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            lparayno Lee Parayno
            Votes:
            10 Vote for this issue
            Watchers:
            30 Start watching this issue

              Created:
              Updated: