lua-resty-mongol icon indicating copy to clipboard operation
lua-resty-mongol copied to clipboard

GridFS "chunkSize" is stored as a BSON float

Open ajdavis opened this issue 10 years ago • 0 comments

We got a report that lua-resty-mongol stores "chunkSize" as a BSON float instead of an int. This causes PyMongo to throw an exception trying to read GridFS files stored by lua-resty-mongol, and it will likely cause other MongoDB drivers to throw exceptions as well:

https://jira.mongodb.org/browse/PYTHON-749

The symptom will be that when you query the "files" collection using the Mongo shell, you can find documents where chunkSize is a float type:

db.fs.files.find({chunkSize: {$type: 1}})

... but not int32 type:

db.fs.files.find({chunkSize: {$type: 16}})

If the driver is storing files in GridFS correctly, then chunkSize will be int type: $type: 16.

Is this the right place to file this, or shall I file it on the upstream "mongol" project?

ajdavis avatar Oct 08 '14 16:10 ajdavis