[DRIVERS-621] Missing API to update metadata for a grid fs file Created: 13/Mar/19 Updated: 31/Mar/22 |
|
| Status: | Backlog |
| Project: | Drivers |
| Component/s: | GridFS |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Varun Agrawal | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | gridfsv2 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I cannot find any way to update metadata for grid fs file. Only option is to specify it when uploading the file. But I need to be able to update it later. |
| Comments |
| Comment by Jeremy Mikola [ 18/Mar/19 ] |
|
To elaborate, the GridFS spec supports a bucketName option, which defaults to "fs". If you've not customized the bucket name, you'll want to manually create a Collection for the "fs.files" collection. There is a table in the File Upload section of the spec that describes the schema for documents in this collection ("metadata" is listed therein). The "_id" field of documents in the "fs.files" collection will correspond to the file ID used with (and returned by) other bucket methods. |
| Comment by Ian Whalen (Inactive) [ 18/Mar/19 ] |
|
Hey varun@varunagw.com we're moving this to the DRIVERS project because this would really be a drivers-wide decision if we want to support this. In the meantime, you can use the collection api to modify the file document directly. |