I am using Mongo crud repository in java spring boot project, for entity like id:"1",id:"2",id:"3", I want to return List of String like ["1","2","3"] I am using findAllById and response is {id:1,id:2,id:3} I converted it into ["1","2","3"] by using loop and then return list.
for(Entity entity:entity.findAllById()) {
list.add(store.getId());
}
is this possible without using this loop I can do the same and return string list .