Test to_mongo for serialization.