Fyi, for anyone curious, I was able to resolve this issue using bson’s EJSON.serialize() function. So I have my encoders construct the appropriate format (with the $date nested field), and then I call EJSON.serialize() on it, which converts it to the appropriate bson object. Once this is saved, MongoDb is able to interpret it correctly.

1 Like