@Override public QueryResult<Long> count(Query query) { Bson bson = parseQuery(query); return mongoDBCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) { Bson bsonDocument = parseQuery(query); return mongoDBCollection.count(bsonDocument); }
@Override public QueryResult<Long> count(Query query) { Bson document = parseQuery(query); return mongoDBCollection.count(document); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query); return userCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) { Bson bson = parseQuery(query); return mongoDBCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); return individualCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); return familyCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) { Bson bsonDocument = parseQuery(query); return mongoDBCollection.count(bsonDocument); }
@Override public QueryResult<Long> count(Query query) { Bson bson = parseQuery(query); return mongoDBCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) { Bson document = parseQuery(query); return mongoDBCollection.count(document); }
@Override public QueryResult<Long> count(Query query) { Bson bson = parseQuery(query); return mongoDBCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); return datasetCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); return sampleCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); return fileCollection.count(bson); }
@Override public QueryResult<Long> count(Query query) { Document mongoQuery = queryParser.parseQuery(query); return variantsCollection.count(mongoQuery); }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); return clinicalCollection.count(bson); }
private boolean filePathExists(long studyId, String path) { Document query = new Document(PRIVATE_STUDY_ID, studyId).append(QueryParams.PATH.key(), path); QueryResult<Long> count = fileCollection.count(query); return count.getResult().get(0) != 0; }
@Override public QueryResult<Long> count(Query query) throws CatalogDBException { Bson bson = parseQuery(query, false); logger.debug("Interpretation count: query : {}, dbTime: {}", bson.toBsonDocument(Document.class, MongoClient.getDefaultCodecRegistry())); return interpretationCollection.count(bson); }
private void checkCohortNameExists(long studyId, String cohortName) throws CatalogDBException { QueryResult<Long> count = cohortCollection.count(Filters.and( Filters.eq(PRIVATE_STUDY_ID, studyId), Filters.eq(QueryParams.ID.key(), cohortName))); if (count.getResult().get(0) > 0) { throw CatalogDBException.alreadyExists("Cohort", "name", cohortName); } }
public long cleanTrash(long timeStamp) { MongoDBCollection collection = getTrashCollection(); // Try to get one variant beyond the ts. If exists, remove by query. Otherwise, remove the whole collection. QueryOptions queryOptions = new QueryOptions(QueryOptions.LIMIT, 1).append(QueryOptions.SKIP_COUNT, true); int results = collection.find(gt(DocumentToTrashVariantConverter.TIMESTAMP_FIELD, timeStamp), queryOptions).getNumResults(); if (results > 0) { return collection.remove(lte(DocumentToTrashVariantConverter.TIMESTAMP_FIELD, timeStamp), null).first().getDeletedCount(); } else { long numElements = collection.count().first(); db.dropCollection(configuration.getString(COLLECTION_TRASH.key(), COLLECTION_TRASH.defaultValue())); return numElements; } }