The results of the mediation analysis suggest that although BDNF is a biomarker affected by T2DM and cognition, it does not play a mediator role between cognitive impairment and diabetes. This evidence concerns the gene BDNF and type 2 diabetes mellitus.