Deprecate 2.0 GridFS API: GridFS file.length is 1 not actual file length

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.3.0
    • Affects Version/s: None
    • Component/s: GridFS
    • None
    • Environment:
      ruby 2.3.0p0 (2015-12-25 revision 53290)
      Using mongo 2.2.6
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the mongo shell I see the actual length of my file in GridFS, however in the mongo ruby driver I get a length of 1 for the same file.

      mongo shell:
      `db.fs.files.find({_id: ObjectId("57898fa2b5e1b565d4b9b5c8")})

      { "_id" : ObjectId("57898fa2b5e1b565d4b9b5c8"), "uploadDate" : ISODate("2016-07-16T01:36:34.161Z"), "length" : 127716, "chunkSize" : 261120, "md5" : "023bf136d694f8071623fb4c67e159b8" }

      `

      mongo ruby driver:
      code- `myid = BSON::ObjectId.from_string("57898fa2b5e1b565d4b9b5c8")
      result = fs_bucket.find_one(_id: myid).to_json
      obj = JSON.parse(result)
      puts obj['info']`
      output- `{"document"=>{"_id"=>

      {"$oid"=>"57898fa2b5e1b565d4b9b5c8"}

      , "chunkSize"=>261120, "uploadDate"=>"2016-07-17T21:51:28.897Z", "contentType"=>"binary/octet-stream", "length"=>1, "md5"=>"023bf136d694f8071623fb4c67e159b8"}, "client_md5"=>{}}`

              Assignee:
              Unassigned
              Reporter:
              Daniel Weller
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: