-
Type:
Bug
-
Resolution: Gone away
-
Priority:
Major - P3
-
None
-
Affects Version/s: 0.3.0
-
Component/s: BSON
-
None
-
Environment:OS X 10.14.3
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When querying documents with fields storing ObjectIDs, occasionally the ObjectID is returned as: ObjectID("000000000000000000000000"). The actual id in a particular record is: "5c7fd4bbd30c2768159c7119"
The struct looks like:
type Quote struct {
ID primitive.ObjectID `bson:"_id" json:"id"`
CustomerID primitive.ObjectID `bson:"customerID" json:"customerID"`
Discount *Discount `bson:"discount" json:"discount,omitempty"`
Features string `json:"features"`
JobsheetID primitive.ObjectID `bson:"jobsheetID" json:"jobsheetID"`
Number int `bson:"number" json:"number"`
...
}
The field that is returned with the 0's is JobsheetID. Oddly the CustomerID is good as is the ID, all of the same ObjectID type. I'm able to successfully query the table referencing the JobsheetID by it's proper _id (ID) and the return results for the ID is good.
Baffled here, I'm attempting to switch from a mgo driver but can't proceed with this issue.