Here's something I just tried without thinking if it's necessary or the best way to do it, but it works.
So programatically I could have the _id
available from querying on the files metadata:
Python Shell:
>>> import pymongo
>>> import os
>>> hostname = os.environ['OPENSHIFT_MONGODB_DB_URL']
>>> conn = pymongo.MongoClient(host=hostname)
>>> db = conn.grid_files
>>> collection = db.fs.files
>>> result = collection.find_one({"user_email":"email@email.com","name":"my name","filename":"image.jpg"})
>>> result['_id']
ObjectId('52e119c47091447a86891d98')
# now use the _id to delete the file
>>> files_id = result['_id']
>>> import gridfs
>>> fs = gridfs.GridFS(db)
>>> fs.delete(files_id)