[CXX-1722] How to set “contentType” field in GridFS? Created: 30/Jan/19 Updated: 27/Oct/23 Resolved: 01/Feb/19 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Betty Leung | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux OS (RHEL), mongocxx driver 3.4, and C++ 11. |
||
| Description |
|
I'm writing a RESTful call to save JPEG files in my MongoDB instance. I would like to set the field contentType in the document when I upload to the fs.files collection. However I don't see a way to set that field even after checking the uploader and bucket classes. How do I set the contentType field in the in a document in fs.files ? |
| Comments |
| Comment by Betty Leung [ 31/Jan/19 ] |
|
Thank you for the info Kevin. |
| Comment by Kevin Albertson [ 31/Jan/19 ] |
|
Hi betty.leung@interpreta.com, The GridFS specification deprecated the contentType option with the rationale being:
The mongocxx::options::gridfs::upload options do not include the deprecated contentType, but do include the metadata option. Best, |
| Comment by Betty Leung [ 30/Jan/19 ] |
|
This is the field I am trying to set: |