[GODRIVER-1666] Constants for operators Created: 25/Jun/20  Updated: 30/Mar/22

Status: Backlog
Project: Go Driver
Component/s: API
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Bradley Wilson-Hunt Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

Would it be possible to define constants for the mongo operators somewhere in the library? e.g.

const (
  Set = "$set"
  Unset = "$unset"
  CurrentDate = "$currentDate"
  .....
)

 

We recently started using sonarqube and it rightly so complains about duplicating strings in the code more than x times.

 

We maintain an internal set of libraries where we could also consider adding these but I would assume more people would benefit from having these into the core library.

 


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