if (!databaseService.getDbList().contains(dbName)) {
throw new DatabaseException(ErrorCodes.DB_DOES_NOT_EXISTS, "DB [" + dbName + "] DOES NOT EXIST");
}
GridFS gridFS = new GridFS(mongoInstance.getDB(dbName), bucketName);
GridFSInputFile fsInputFile = gridFS.createFile(inputStream, fileData.getFileName());
fsInputFile.setContentType(formData.getMediaType().toString());
fsInputFile.save();
String objectId = JSON.serialize(fsInputFile.getId());
JSONObject obj = new JSONObject();
obj.put("name", fsInputFile.getFilename());