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

A cursor with oplogReplay does not perform any field projection

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.19, 3.4.14, 3.6.3, 3.7.3
    • Component/s: Querying
    • Labels:
    • ALL
    • Hide

      Attempt to use the oplogReplay and projection options in the same query.

      Show
      Attempt to use the oplogReplay and projection options in the same query.

      A cursor created with the oplogReplay option does not perform any projection:

      MongoDB shell version v3.6.3
      connecting to: mongodb://127.0.0.1:27017
      MongoDB server version: 3.6.3
      PRIMARY> db.getSiblingDB("local").oplog.rs.find({ts: {$gte: Timestamp(0, 0)}}).sort({$natural:-1}).limit(1).oplogReplay().projection({"ts":1})
      { "ts" : Timestamp(1521826871, 1), "h" : NumberLong("-7809205279583470656"), "v" : 2, "op" : "n", "ns" : "", "wall" : ISODate("2018-03-23T17:41:11.487Z"), "o" : { "msg" : "initiating set" } }
      PRIMARY> db.getSiblingDB("local").oplog.rs.find({ts: {$gte: Timestamp(0, 0)}}).sort({$natural:-1}).limit(1).projection({"ts":1})
      { "ts" : Timestamp(1521826873, 5) }
      

            Assignee:
            asya.kamsky@mongodb.com Asya Kamsky
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: