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

change stream source startAtOperationTime with date

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Atlas Streams
    • Fully Compatible
    • Sprint 50, Sprint 51

      Current change stream sources that need to start at a specific time have to pass a timestamp to $source.config.startAtOperationTime. Creating this timestamp is very convoluted and not straight forward for users. We should look at adding the ability to pass a date string to simplify the user experience. 

       

      s = {
          $source: { connectionName: 'jsncluster0', 
           db: 'test',
            coll: 'format',  
            config : {
              fullDocument: 'whenAvailable',
              fullDocumentBeforeChange: 'whenAvailable',
              startAtOperationTime : ISODate("2024-04-05T00:00:01Z"),
                              pipeline : [{ $match: { 'fullDocument.num': 1 } }]}
            } }
        
      ####
      
            { $toDate : "2024-04-5T00:00:01Z"} // Failed to create stream processor: BSON field '$source.config.startAtOperationTime' is the wrong type 'object', expected type 'timestamp', 
            { $dateFromString: {dateString: "2024-04-5T00:00:01Z"} } //object
            ISODate("2024-04-05T00:00:01Z") //Failed to create stream processor: BSON field '$source.config.startAtOperationTime' is the wrong type 'date', expected type 'timestamp'
       "2024-04-05T00:00:01Z" // string, wrong type
      
      This works - Timestamp(new Date('2024-01-30T00:00:01Z').getTime()/1000 

       

      https://mongodb.slack.com/archives/C04AH2TF7E1/p1712344486612879

            Assignee:
            saloni.modi@mongodb.com Saloni Modi (Inactive)
            Reporter:
            joe.niemiec@mongodb.com Joe Niemiec
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: