Details
-
Task
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
Description
The use of regexes in Go Driver is neither obvious nor well documented.
In the driver package docs no regexes mentioned at all, at least I didn't find: https://pkg.go.dev/go.mongodb.org/mongo-driver@v1.11.2
As a result people trying to creates reges something like:
regex := primitive.Regex{Pattern: "/pattern/", Options: "i"}
|
And it does not work, the correct code should be
regex := primitive.Regex{Pattern: "pattern", Options: "i"}
|
After some research I managed to find this page https://pkg.go.dev/go.mongodb.org/mongo-driver@v1.11.2/bson/primitive#Regex
but it was just empty.
I believe at least one example of using regexes should be added to the driver package's docs: https://pkg.go.dev/go.mongodb.org/mongo-driver@v1.11.2 Since it is not obvious how to do it.
And the link to "primitives" package from the driver package should be easily accessible.
A/C:
As a user, I can see how to create regular expressions with the Go driver.
As a user, I can find a link to the "primitives" package in the driver.
Attachments
Issue Links
- depends on
-
GODRIVER-2816 Create Documentation Examples for primitive.Regex Usage
-
- Closed
-