[GODRIVER-736] Add comparison methods to primitive.Timestamp Created: 21/Dec/18  Updated: 28/Oct/23  Resolved: 31/May/19

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: 0.1.0
Fix Version/s: 1.1.0

Type: New Feature Priority: Minor - P4
Reporter: David Golden Assignee: Run Tian Yu (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by TOOLS-1833 Migrate tools (excluding mongoreplay)... Closed

 Description   

Tools and mongomirror do lots of timestamp comparison.  It would be helpful if the primitive.Timestamp type also provided comparison methods like Greater and GreaterOrEqual, or just a Cmp method (returning -1, 0, 1).



 Comments   
Comment by Githook User [ 31/May/19 ]

Author:

{'name': 'Connie Yu', 'email': 'connie.yu@10gen.com', 'username': 'connieyu'}

Message: Add Compare method to primitive.Timestamp

GODRIVER-736

Change-Id: I89dfaeb3cb6e9d17ffe1d4574be483e2e115f3cd
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/453f7020a6ab7d098ef64c6e306f47124336439e

Comment by Divjot Arora (Inactive) [ 31/May/19 ]

We plan to add a general Compare(lhs, rhs primitive.Timestamp) function that returns -1 if lhs < rhs, 1 if lhs > rhs, and 0 if lhs = rhs.

Generated at Thu Feb 08 08:34:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.