In my Spring Boot application I used GridFS to store large file in my database. To find certain files, I use normal queries on the files collection:
GridFSFile file = gridFsTemplate.findOne(Query.query(Criteria.where(ID).is(id)));
but with this approach I'm getting the entire file.
My question is, how to create some queries without loading the whole file in the memory? My stored files are books ( in pdf format ) and suppose I want to get the content from certain page without loading the entire book in the memory. I'm guessing I'll have to use the chunk collection and perform some operations to the chunks but I cannot find how to do that.