value = new org.bson.types.CodeWScope(code.getCode(), createMongoData(code.getScope()));
} else if (value instanceof Code) {
Code code = (Code)value;
value = new org.bson.types.Code(code.getCode());
} else if (value instanceof Binary) {
Binary binary = (Binary)value;
value = new org.bson.types.Binary(binary.getBytes());
} else if (value instanceof List) {
List<?> values = (List<?>)value;
BasicBSONList newValues = new BasicBSONList();
for (Object v : values) {
newValues.add(createMongoData(v));