in java code, I am using the aggregation method. like- mongoTemplate.aggregate(aggregation,Request.class, Response.class).getMappedResults();
and manually I remove the collection and want to it throw error when collection is not exist but with above code return null value and does not throw any error how we can achieve to throw error in case collection not exist and return response if collection exist. and don't want to separate to check collection is exist or not. or mongotemplate does not throw error if collection is not exists