[GODRIVER-635] string and []byte is not supported Created: 10/Nov/18 Updated: 27/Oct/23 Resolved: 03/Dec/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Mihai B | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Trying to store strings or []byte results into a marshal error <code> 500:cannot transform type string to a *bson.Document </code> . I understand that Mongo is used mainly for structured data but support for unstructured data even only at the client level would make it more useful/easier to use. |
| Comments |
| Comment by Kristofer Brandow (Inactive) [ 12/Nov/18 ] |
|
Hi themihai, You should be able to use []byte as an argument if you type convert it to bson.Raw. What are the contents of the string you want to store? If it's extended JSON, you should unmarshal that into a bson.Document and then use that as the argument to the CRUD methods. --Kris |