Dopamine has been thought to play an important role in updating values according to reward prediction error by reinforcement learning theory, since the finding that phasic activity of midbrain dopamine neurons signals the difference between actual and predicted outcomes (reward prediction error). However, the extent and nature of dopamine roles in reward-based learning are still under debate. Specific roles of different dopamine receptor subtypes in this process are also unknown. To investigate roles of dopamine receptor subtypes in reward-based learning, I examined choice behavior of dopamine D1 and D2 receptor-knockout (D1R-KO and D2R-KO, respectively) mice in an instrumental learning task with progressively increasing reversal frequency and in a dynamic foraging task. Performance of D2R-KO mice was progressively impaired in an instrumental learning task as the frequency of reversal increased and profoundly impaired in a dynamic foraging task even with prolonged training, whereas D1R-KO mice showed only minor deficits in performance. Animals’ choice behavior in the dynamic foraging was better explained by hybrid model that included win-stay-lose-switch and reinforcement learning terms than by simple reinforcement learning alone. A hybrid model-based analysis revealed that D1R-KO mice showed the increased win-stay and uncertainty-based exploration, and D2R-KO mice also showed the increased win-stay, but at the same time, showed the impaired value updating and increased randomness in action selection which were detrimental to maximizing rewards in the dynamic foraging task. These results indicate that dopamine D2 receptors rather than D1 receptors are important in learning from past choice outcomes for optimizing choice strategy in a dynamic and uncertain environment.