def _update_indexes_for_mutated_object(collection, obj):
    """If an object is updated, this will simply remove
    it and re-add it to the indexes defined on the
    collection."""
    for index in _db[collection].indexes.values():
        _remove_from_index(index, obj)
        _add_to_index(index, obj)