Which of the following queries would return documents for all customers aged 65 or older?

Prepare for the MongoDB Associate Developer Exam with flashcards and practice multiple choice questions. Each question includes hints and explanations to ensure you're ready for test day.

The query that would return documents for all customers aged 65 or older is the one structured as { "customer.age" : { $gte : 65 }}. The operator $gte stands for "greater than or equal to," which means that it will include all customers who are 65 years of age and any older.

Using $gte ensures that the query captures exactly the group of customers desired, which includes those who meet the age condition of being 65 years old and above. This operator is crucial for inclusive queries where a specific threshold must be reached or exceeded.

In contrast, other query structures using different operators would provide results that do not meet the requirement for customers aged 65 or older. For example, $gt (greater than) would only find those older than 64, not including 64 itself. Similarly, $lt (less than) and $lte (less than or equal to) would filter out any customers aged 65 or older, as they focus on customers younger than that age threshold.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy