Skip to content

Commit

Permalink
Update docs/migration-2.0.md
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com>
  • Loading branch information
prestonvasquez and matthewdale authored Nov 15, 2024
1 parent 5538c77 commit be0f046
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/migration-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ fmt.Println("type of data is an array: %v", bson.Type(btype) == bson.TypeArray)

### ValueUnmarshaler

The `UnmarshalBSONValue` method of the `ValueUnmarshaler` interface is only required to take a byte type argument representing the BSON type to avoid importing the Go driver package. For example:
The `UnmarshalBSONValue` method of the [ValueUnmarshaler](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/bson#ValueUnmarshaler) interface now accepts a `byte` value representing the [BSON type](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/bson#Type) for the first argument. That allows packages to implement `ValueUnmarshaler` without having to import the `bson` package. For example:

```go
if err := m.UnmarshalBSONValue(bson.TypeEmbeddedDocument, bytes); err != nil {
Expand Down

0 comments on commit be0f046

Please sign in to comment.