It might be possible to use the return value of remove()[0] to determine whether a document was removed or not, rather than having to query to see if the TaskStatus exists before removing it. Unfortunately, the remove() documentation isn't too clear about what information is returned by it, so I can understand if you would prefer not to go that route. I bet it does tell you how many records were removed though, and if that is True, you could check that to know if you should raise the MissingResource(). It would save a query. Due to the poor documentation, feel free to keep it as you have it if you like.

[0] http://api.mongodb.org/python/current/api/pymongo/collection.html#pymongo.collection.Collection.remove