adding the POST body and collection name to middleware