def query_or_command(op):
    """
    Given an operation from currentOp, return the query or command
    field as it changed in MongoDB 3.2 for indexing operations:

    https://docs.mongodb.com/manual/reference/method/db.currentOp/#active-indexing-operations
    """
    return op.get('command') or op.get('query')