mongoengine
mongoengine copied to clipboard
Consider adding a lock to FileField
Although there's no protocol for locking and concurrency for GridFS, I think it's better not to silently omit this problem with FileField. See https://gist.github.com/1980712. Please consider adding a lock or at least try to warn the developer in such case.
The result's like:
Create document object...
Writing finished...
>>> Doc:
ID: 4f55195832c05f4b4a000001
File: 4f55195832c05f4b53000002
>>> GridFS:
[u'File_19282', u'File_19283']
There are two files in GridFS but we only have one reference.