@Override public Document convertToStorageType(File file, List<VariableSet> variableSetList) { Document document = super.convertToStorageType(file, variableSetList); document.remove(SampleDBAdaptor.QueryParams.ANNOTATION_SETS.key()); document.put("uid", file.getUid()); document.put("studyUid", file.getStudyUid()); long jobId = file.getJob() != null ? (file.getJob().getUid() == 0 ? -1L : file.getJob().getUid()) : -1L; document.put("job", new Document("uid", jobId)); document.put("samples", convertSamples(file.getSamples())); document.put(FileMongoDBAdaptor.REVERSE_NAME, StringUtils.reverse(file.getName())); return document; }