<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload_cart(cart, collection):
 """ Connect to mongo and store your cart in the specified collection. """

    cart_cols = cart_db()

    cart_json = read_json_document(cart.cart_file())
    try:
        cart_id = cart_cols[collection].save(cart_json)
    except MongoErrors.AutoReconnect:
        raise JuicerConfigError("Error saving cart to `cart_host`. Ensure that this node is the master.")
    return cart_id