[JAVA-1013] Saved extra fields for Gridfs does not go in metadata sub-document Created: 13/Oct/13 Updated: 07/Apr/23 Resolved: 02/Sep/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | GridFS |
| Affects Version/s: | 2.11.1 |
| Fix Version/s: | 3.1.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | OptimusPrime | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
mongodb working at ubuntu 11 x64. |
||
| Description |
|
When put some metadata for a file to save with Gridfs, extradata should go into the metadata field (sub document). But it doesn't. Following code demonstrates to issue.
The expected output of db.mycoll.files.find() is this:
But it is saved as this:
|
| Comments |
| Comment by Ross Lawley [ 02/Sep/15 ] |
|
Fixed in the new GridFS implementation Reading legacy metadata stored outside the metadata document is supported. |
| Comment by Jeffrey Yemin [ 14/Oct/13 ] |
|
I tried this with the 2.9.3 driver and got the exact same results as you did with 2.11.3. Are you seeing something different? |
| Comment by OptimusPrime [ 13/Oct/13 ] |
|
I am perfectly sure about that it is working in mongodb 2.2.1 with java-driver 2.9.3.. |
| Comment by Jeffrey Yemin [ 13/Oct/13 ] |
|
See http://docs.mongodb.org/manual/reference/gridfs/#files.metadata. Have to think about this one a bit. While doing this would be to spec, it would be a breaking change for applications relying on the current behavior. One option would be to write to both locations during a transition period. |