spring-projects / spring-projects/spring-data-mongodb
Provide a way to set options on the GridFSBucket instance used in GridFsTemplate [DATAMONGO-2165]
@christophstrobl is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
ogerardin opened DATAMONGO-2165 and commented
GridFSBucket has a set of configurable options, namely:
- bucketName
- chunkSizeBytes
- disableMD5
- readConcern
- readPreference
- writeConcern
Currently there's no way to set any of these options on the GridFSBucket instance used by GridFsTemplate. The instance is provided by method getGridFs() which just calls GridFSBuckets.create(db) or GridFSBuckets.create(db, bucket) depending if we have a bucket name or not. All options have default values.
An easy and quick fix is to make the GridFsTemplate class extendable, and in particular to make the method getGridFs() overridable so that one could customize the GridFSBucket instance returned by this method using any of the GridFSBucket.withXXX() methods.
Or the GridFsTemplate could use a GridFSBucketFactory, or any other mechanism to allow the customization of the GridFSBucket.
Affects: 2.1.3 (Lovelace SR3)
Reference URL: https://stackoverflow.com/questions/53728853/how-do-i-disable-gridfs-md5-calculation-in-spring-boot
1 votes, 2 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.