def put(self, data, **kwargs):
        collection = self._GridFS__collection
        if 0 == collection.write_concern.get('w'):
            raise pymongo.errors.ConfigurationError(
                "Motor does not allow unacknowledged put() to GridFS")

        grid_in = grid_file.GridIn(collection, **kwargs)

        try:
            grid_in.write(data)
        finally:
            grid_in.close()

        return grid_in._id
Put data into GridFS as a new file.
dataset/ETHPy150Open mongodb/motor/motor/motor_gridfs.py/_MotorDelegateGridFS.put