[DOCS-9647] Documentation on GridFS on arbitrary fields in the files collection incorrect Created: 13/Dec/16 Updated: 22/Aug/17 Resolved: 22/Aug/17 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Roy Rim | Assignee: | Steve Renaker (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 6 years, 28 weeks ago |
| Description |
|
Hello, There is a discrepancy between the GridFS spec and the MongoDB GridFS documentation. In the MongoDB GridFS doc doc it says: "Applications may create additional arbitrary fields." In the GridFS Spec it says: "Note: some older versions of GridFS implementations allowed applications to add arbitrary fields to the files collection document at the root level. New implementations of GridFS will not allow this, but must be prepared to handle existing files collection documents that might have additional fields." I've been told in HELP-3290 that the MongoDB documentation is wrong and that it needs to be updated to follow the spec. |
| Comments |
| Comment by Steve Renaker (Inactive) [ 02/Aug/17 ] |
|
OK, I'm going to change the existing doc to instruct users to put arbitrary fields into the metadata object and not even mention arbitrary fields at the top level of the document, since it's a gray area and more likely to confuse than to clarify. |
| Comment by Bernie Hackett [ 01/Aug/17 ] |
|
That HELP ticket is specifically about the legacy GridFS API in the Java driver. Part of the reason we did a spec for this is that each driver had a completely different API for GridFS. Hence something you try that works in the legacy API of one driver may not be supported in the legacy API of another driver. |
| Comment by Bernie Hackett [ 01/Aug/17 ] |
|
Since GridFS is entirely a client side feature, the server docs should match the behavior defined by the driver spec. |
| Comment by Steve Renaker (Inactive) [ 01/Aug/17 ] |
|
behackett Hi Bernie, would you like to weigh in on this? Apparently the drivers will allow users to add arbitrary fields to GridFS documents, but we're trying to encourage them to confine arbitrary fields to the "metadata" field. How should I handle this in the GridFS documentation? |
| Comment by Roy Rim [ 01/Aug/17 ] |
|
Hey steve.renaker I think that would be ok but I wonder what the driver team thinks. They may want us to actively guide customers away from doing things the old way since it will be removed at some point. |
| Comment by Steve Renaker (Inactive) [ 01/Aug/17 ] |
|
roy.rim Then what I'll say in the docs is that arbitrary fields SHOULD go in the metadata field, but not that they are not allowed elsewhere at all. OK? |
| Comment by Roy Rim [ 26/Jul/17 ] |
|
steve.renaker according to this comment on my help ticket arbitrary fields are meant to go in the metadata field going forward. |
| Comment by Steve Renaker (Inactive) [ 25/Jul/17 ] |
|
roy.rim Hi Roy, I haven't been able to confirm this myself. I used pymongo version 3.2 to add arbitrary fields to a GridFS collection with mongod 3.4: >>> a = fs.put(b"hello world", bar="baz") { "_id" : ObjectId("5977835ce550eb1a233deafa"), "bar" : "baz", "chunkSize" : 261120, "length" : 11, "uploadDate" : ISODate("2017-07-25T17:43:56.461Z"), "md5" : "5eb63bbbe01eeed093cb22bb8f5acdc3" }Am I using the wrong environment for testing here? Thanks, |