Go mongo driver throws error stating:
write exception: write errors: [‘timestamp’ must be present and contain a valid BSON UTC datetime value]
Tried values for timestamp field in code are as follows:
dataForDB[“timestamp”] = map[string]interface{}{“$timestamp”: primitive.Timestamp{T: uint32(time.Now().Unix())}}
and
dataForDB[“timestamp”] = primitive.Timestamp{T: uint32(time.Now().Unix())}
Both of these fail with the same error as stated above.
Any help is appreciated.
Thanks ![]()