[CXX-2295] [ChangeStream] options::change_stream::start_at_operation_time accept uses internal bsoncxx::types::b_timestamp in API Created: 30/Jun/21  Updated: 28/Oct/23  Resolved: 02/Aug/23

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.8.1

Type: Bug Priority: Unknown
Reporter: Puya Daravi Assignee: Adrian Dole
Resolution: Fixed Votes: 0
Labels: neweng, post-5.0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Quarter: FY24Q3

 Description   

There is a warning against using bsoncxx::types::b_timestamp in user code:

> This BSON type is used internally by the MongoDB server - use by clients is discouraged.

However the options::change_stream::start_at_operation_time API requires you to pass in this type as input. Please either:

  • Remove the warning from b_timestamp or
  • Use an std type like std::chrono::system_clock::time_point

(second option seems better to me)



 Comments   
Comment by Githook User [ 05/Oct/23 ]

Author:

{'name': 'Adrian Dole', 'email': 'adrian@dole.tech', 'username': 'adriandole'}

Message: CXX-2295 remove warning from b_timestamp
Branch: releases/stable
https://github.com/mongodb/mongo-cxx-driver/commit/653a0b570d5c214edfd0a4805473fcb6f6e4b475

Comment by Githook User [ 05/Sep/23 ]

Author:

{'name': 'Adrian Dole', 'email': 'adrian@dole.tech', 'username': 'adriandole'}

Message: CXX-2295 remove warning from b_timestamp
Branch: releases/v3.8
https://github.com/mongodb/mongo-cxx-driver/commit/653a0b570d5c214edfd0a4805473fcb6f6e4b475

Comment by Adrian Dole [ 02/Aug/23 ]

Warning removed for b_timestamp.

Comment by Githook User [ 02/Aug/23 ]

Author:

{'name': 'Adrian Dole', 'email': 'adrian@dole.tech', 'username': 'adriandole'}

Message: CXX-2295 remove warning from b_timestamp
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/35ee0782367b84dae871b65b4d03d70134bd4d3e

Comment by Kevin Albertson [ 19/Jul/21 ]

Hello puya@motionmetrics.com, thank you for the report! We will further investigate this after we have completed high priority work for upcoming server support. Thank you for your patience.

Comment by Puya Daravi [ 30/Jun/21 ]

Seems like I cannot edit. My proposed stl type (instead of the system dependent std::chrono::system_clock::time_point) is to use:
time_point<system_clock, microseconds>

Because the number of seconds can be represented by timestamp and the number of microseconds by the increment when converting to b_timestamp.

Generated at Wed Feb 07 22:05:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.