I am using GridFsOperations API of spring-data for mongodb to store large files in chunks in the db. Here is my code:
@Autowired private GridFsOperations gridOperation; public String save(InputStream inputStream, String contentType, String filename) { ... GridFSFile file = gridOperation.store(inputStream, filename, metaData); return file.getId().toString(); }The code works fine but it always stores files in collections starting with prefix "fs", which is the default in mongodb. Is there a way to specify a different prefix so that I can have different files and chunks for different kinds of files to be stored?
EDIT: additional question
How do I specify the chunk size? Is it advisable to have different chunk sizes for different kinds of files, for example, 1 mb for image files and 10 mb for video files?
Thanks in advance