Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2681 Replace CompareTimestamp with Before, After and Compare methods. #1182

Merged

Conversation

matthewdale
Copy link
Collaborator

GODRIVER-2681

Summary

  • Add primitive.Timestamp methods Before, After, and Compare.
  • Deprecate the primitive.CompareTimestamp function.

Background & Motivation

The primitive.CompareTimestamp function is not a Go idiomatic API. Replace it with primitive.Timestamp methods Before, After, and Compare (inspired by Go's time.Time API). Deprecate primitive.CompareTimestamp and suggest using the new methods.

Copy link
Collaborator

@qingyang-hu qingyang-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

bson/primitive/primitive.go Show resolved Hide resolved
bson/primitive/primitive.go Outdated Show resolved Hide resolved
matthewdale and others added 2 commits February 15, 2023 16:03
Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
@matthewdale matthewdale merged commit ccf2d23 into mongodb:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants