@ Override public < S extends T > long count ( final Example < S > example ) { final Map < String , Object > bindVars = new HashMap <> ( ) ; final String predicate = exampleConverter . convertExampleToPredicate ( example , bindVars ) ; final String filter = predicate . length ( ) == 0 ? "" : " FILTER " + predicate ; final String query = String . format ( "FOR e IN %s%s COLLECT WITH COUNT INTO length RETURN length" , getCollectionName ( ) , filter ) ; final ArangoCursor < Long > cursor = arangoOperations . query ( query , bindVars , null , Long . class ) ; return cursor . next ( ) ; }
Counts the number of documents in the collection which match with the given example