DBCollection coll = this.mongoTemplate.getCollection("profileInterest");
DBObject project = new BasicDBObject("$project", new BasicDBObject("_id", 1).append("fromProfile", 1).append("toProfile", 1)
.append("isContactNoViewed", 1).append("isShortListed", 1)
.append("interestStatusTotal", new BasicDBObject("$size", "$interestStatus"))
.append("interestStatus", new BasicDBObject("$slice", new Object[] { "$interestStatus", 1 })));
DBObject match = new BasicDBObject("$match", new BasicDBObject("threeFavorites.id", new BasicDBObject("$ne", 100)));
@SuppressWarnings("deprecation")
AggregationOutput output = coll.aggregate(project, match);