def handle_patch()

in docdb_rest/app.py [0:0]


def handle_patch(event):
    collection = collection_from_event(event)
    filter = None
    update = None
    body = json.loads(event["body"])
    print(event["body"])
    print(body)
    if "filter" in body.keys():
        filter = body["filter"]
    if "update" in body.keys():
        update = body["update"]
    print(filter)
    print(update)
    res = collection.update_many(filter, update)
    return stringify(res.raw_result)