MongoDB: return just the document from an array that matches a certain query (JS)
I have a MongoDB collection in the form of: users: { { user_id: 1000, activities: [ {id: 1, activity: 'swimming'}, {id: 2, activity: 'running'}, {id: 3, activity: 'biking'},... ] },... } and I want to get the activity document that…