def save_form(db, form):
    """Saves a form to the database.

    :param db: The database to store the form in.
    :param form: The form to store.
    :return: The generated ID of the form.
    """

    forms = db.forms
    result = forms.insert_one(form)
    return str(result.inserted_id)