I'm new to MongoDB work and I need help in the following.
I have a collection named student
in MongoDB. And I have the following data in it.
{'_id': 1, 'name': 'A', 'dt_joined': '2010'}
{'_id': 2, 'name': 'B', 'dt_joined': '2011'}
{'_id': 3, 'name': 'C', 'dt_joined': '2009'}
{'_id': 4, 'name': 'D', 'dt_joined': '2010'}
{'_id': 5, 'name': 'E', 'dt_joined': '2008'}
From the above collection, I want to retrieve (_id, dt_joined) from all the records. That means, I'm expecting the following result.
{'_id': 1, 'dt_joined': '2010'}
{'_id': 2, 'dt_joined': '2011'}
{'_id': 3, 'dt_joined': '2009'}
{'_id': 4, 'dt_joined': '2010'}
{'_id': 5, 'dt_joined': '2008'}
Is it possible with the MongoDB find command?
Thanks in advance!!