[GODRIVER-859] Error Decoding struct Created: 02/Mar/19  Updated: 27/Oct/23  Resolved: 04/Mar/19

Status: Closed
Project: Go Driver
Component/s: JSON & ExtJSON
Affects Version/s: 1.0.0-rc1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Nicola De Filippo Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

go version go1.11.4 darwin/amd64
mongodb v3.4.4



 Description   

After last update, now i have an error decoding a struct

for cur.Next(ctx) { resultFromMongo := Product{} if err = cur.Decode(&resultFromMongo); err != nil

{ fmt.Printf("[Debug] decode error") }

result.Products = append(result.Products, resultFromMongo)}



 Comments   
Comment by Nicola De Filippo [ 02/Mar/19 ]

The problem there is when install the driver with dep. I cleaned the project and installed with go get and all it's ok

Comment by Nicola De Filippo [ 02/Mar/19 ]

// code placeholder

My Product is

type Product struct {
ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` Price float64 `json:"price,omitempty"`

{color:#008000}}
----
I have thsi error decode error cannot decode objectID into an array

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