bigplum / lua-resty-mongol

A ngx_lua driver for mongodb -- Deprecated for not updating with the mongodb version
198 stars 67 forks source link

GridFS "chunkSize" is stored as a BSON float #35

Open ajdavis opened 10 years ago

ajdavis commented 10 years ago

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?