Skip to content

Commit 6ee4748

Browse files
committed
Add support for raw integers with $date
1 parent 2fb348b commit 6ee4748

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bson/bsonrw/extjson_wrappers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ const rfc3339Milli = "2006-01-02T15:04:05.999Z07:00"
184184

185185
func (ejv *extJSONValue) parseDateTime() (int64, error) {
186186
switch ejv.t {
187+
case bsontype.Int32:
188+
return int64(ejv.v.(int32)), nil
189+
case bsontype.Int64:
190+
return ejv.v.(int64), nil
187191
case bsontype.String:
188192
return parseDatetimeString(ejv.v.(string))
189193
case bsontype.EmbeddedDocument:

0 commit comments

Comments
 (0)