MongoDB supports BSON Encoding. The struct with the nullable type introduced can't be encoded as expected in to the database. As you have done JSON Marshal & Marshal, a similar scheme is needed for BSON.