[GODRIVER-300] Support constructing *Value from time.Time instances Created: 24/Mar/18 Updated: 28/Oct/23 Resolved: 24/Oct/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.17 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Sam Kleinman (Inactive) | Assignee: | Isabella Siu (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | beta, evg, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The ElementEncoder supports encoding a time.Time value into a *bson.Element, add this same support to the ValueConstructor. |
| Comments |
| Comment by Githook User [ 24/Oct/18 ] | |||||||||||||
|
Author: {'name': 'Isabella Siu', 'email': 'isabella.siu@10gen.com'}Message: Change-Id: I986962c2c67510b4c68e87bf52712ee41a90dd58 | |||||||||||||
| Comment by Sam Kleinman (Inactive) [ 18/May/18 ] | |||||||||||||
|
The element and value constructors for DateTime (time?) objects should take time.Time objects rather than in64 objects. | |||||||||||||
| Comment by Kristofer Brandow (Inactive) [ 12/Apr/18 ] | |||||||||||||
|
thomas.delacour I'll open a bug for this. | |||||||||||||
| Comment by Thomas Delacour (Inactive) [ 10/Apr/18 ] | |||||||||||||
|
kris.brandow Is the current driver supposed to support marshaling / unmarshaling time.Time objects embedded in structs? I am currently encountering a silent bug with this. | |||||||||||||
| Comment by Ramón Berrutti [ 29/Mar/18 ] | |||||||||||||
|
I was thinking the same yesterday...
| |||||||||||||
| Comment by Karan Razdan [ 28/Mar/18 ] | |||||||||||||
|
I think what Sam is trying to say is bson can create 'DateTime' objects which are of type int64. We should be able to pass in the time.Time objects instead of int64 which restricts us to Unix time.
| |||||||||||||
| Comment by Kristofer Brandow (Inactive) [ 26/Mar/18 ] | |||||||||||||
|
Hi Sam, Can you clarify what you mean here? e.g. are you looking to have support for unmarshaling into a time.Time object embedded in a struct? |