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
- mentioned in
-
Page Loading...