[GODRIVER-321] convertValueToElem should copy the attached *bson.Document Created: 29/Mar/18  Updated: 28/Oct/23  Resolved: 29/Mar/18

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 0.0.2
Fix Version/s: 0.0.3

Type: Bug Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Kristofer Brandow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The function bson.convertValueToElem does not copy the Value.d property, which means that documents and arrays are not properly converted. When marshaling is attempted, an error of Too Small is returned.

To fix this, copy the Value.d property to the newly created value.



 Comments   
Comment by Githook User [ 29/Mar/18 ]

Author:

{'email': 'kris@mongodb.com', 'name': 'Kris Brandow', 'username': 'skriptble'}

Message: Ensure convertValueToElement is properly compared

GODRIVER-321

Change-Id: I6173591c534afca7492d91d1c05f8c89d3abe8f3
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/c2aaa54cd8ad5239e83aa7ac5074c8456749de60

Comment by Kristofer Brandow (Inactive) [ 29/Mar/18 ]

Code Review: https://review.gerrithub.io/c/405805/

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