Background: In view of the rapidly accelerating aging process in China, this study looked at the associations between vegetables and fruits intake pattens and cognitive function among the oldest old in China using the genetic sub study from the Chinese Longitudinal Healthy Longevity Survey (CLHLS). Methods: This study screened respondents who participated in all four surveys of longitudinal data from the CLHLS, and a total of 2454 participants were ultimately included. The relationships of cognitive function with vegetables and fruits intake patterns were examined using Generalized-estimating equations. Results: The prevalence range of mild cognitive impairment (MCI) was 14.3% to 16.9% at T1 to T3 and 32.7% at T4. There was a significant increase in the prevalence of MCI from T1 to T4 (β = 0.054; 95% CI, 0.037 to 0.070;p <0.001; adjusted). The V+/F+ pattern significantly improved cognitive function in Chinese older adults compared with the V−/F− pattern (OR, 1.026; 95% CI, 1.001–1.053;p< 0.05). Conclusion: Older adults who frequently consume both fruits and vegetables experience a reduction in MCI risk relative to those consuming these food groups infrequently—emphasizing the critical importance of the regular intake of both fruits and vegetables in maintaining cognitive function.