Complete the code to find all candidates in the election collection.
db.election.[1]()The find() method retrieves documents from a collection.
Complete the code to count how many votes a candidate named 'Alice' has.
db.votes.countDocuments({ candidate: [1] })We count documents where the candidate field equals 'Alice'.
Fix the error in the query to find votes where the count is greater than 100.
db.votes.find({ count: { [1]: 100 } })The operator $gt means 'greater than'.
Fill both blanks to update the vote count for candidate 'Bob' to 250.
db.votes.updateOne({ candidate: [1] }, { [2]: { count: 250 } })We match candidate 'Bob' and use $set to change the count to 250.
Fill all three blanks to create a dictionary with candidate names as keys and their vote counts as values, but only for counts greater than 100.
result = { [1]: [2] for doc in db.votes.find({ count: { [3]: 100 } }) }We use doc.candidate as keys, doc.count as values, and filter with $gt for counts greater than 100.
