diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/FileMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/FileMongoDBAdaptor.java index 9bcd821405..34983c60b7 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/FileMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/FileMongoDBAdaptor.java @@ -346,8 +346,8 @@ public void associateAlignmentFiles(long studyUid) throws CatalogException { Query query = new Query() .append(QueryParams.STUDY_UID.key(), studyUid) .append(QueryParams.FORMAT.key(), Arrays.asList(File.Format.BAM, File.Format.CRAM)); - QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList(QueryParams.PATH.key(), QueryParams.FORMAT.key(), - QueryParams.RELATED_FILES.key(), QueryParams.INTERNAL.key())); + QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList(QueryParams.UID.key(), QueryParams.PATH.key(), + QueryParams.FORMAT.key(), QueryParams.RELATED_FILES.key(), QueryParams.INTERNAL.key(), QueryParams.STUDY_UID.key())); try (DBIterator iterator = iterator(query, options)) { while (iterator.hasNext()) {