Skip to content

Docs updates. #1608

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

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/common-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These are fixes or information for common issues encountered by Go Driver users.

## `WriteXXX` can only write while positioned on a Element or Value but is positioned on a TopLevel

The [`bson.Marshal`](https://pkg.go.dev/go.mongodb.org/mongo-driver/bson#Marshal) function requires a parameter that can be decoded into a BSON Document, i.e. a [`primitive.D`](https://github.com/mongodb/mongo-go-driver/blob/master/bson/bson.go#L31). Therefore the error message
The [`bson.Marshal`](https://pkg.go.dev/go.mongodb.org/mongo-driver/bson#Marshal) function requires a parameter that can be decoded into a BSON Document, i.e. a [`bson.D`](https://pkg.go.dev/go.mongodb.org/mongo-driver/bson#D). Therefore the error message

> `WriteXXX` can only write while positioned on a Element or Value but is positioned on a TopLevel

Expand Down Expand Up @@ -34,7 +34,7 @@ sort := bson.D{}

## Convert BSON Document to JSON

There are a variety of marshalers that can be used to encode a BSON document as JSON, including [MarshalExtJSON](https://pkg.go.dev/github.com/mongodb/mongo-go-driver/bson#MarshalExtJSON):
There are a variety of marshalers that can be used to encode a BSON document as JSON, including [MarshalExtJSON](https://pkg.go.dev/go.mongodb.org/mongo-driver/bson#MarshalExtJSON):

```go
doc := bson.D{{"x", 1}}
Expand Down
Loading