how do i find last element of array list from MongoDB using aggregation function in spring?
db.getCollection('notification').find({},{statusList:{$slice:-1}}) this query is getting expected outputs but from java, I could not find the solution for this. can anyone have a solution for this? I want to use only the aggregation function