Write a statement that counts the number of documents


Problem

I. Write a statement to retrieve a cursor containing all documents of customers with g()mail.com email addresses. (Hint: Look into how to use the $text operator in the MongoDB documentation. In using this operator, also look for how to escape quotes to find the whole search phrase.)

II. Write a statement that counts the number of documents for customers who were born in 1990 or later. (Hint: You'll have to use the $gte operator and pass ISODate("1990-01-01") as a value in the query.)

III. Write a statement that returns a cursor to documents for customers who have David in their name. (Hint: You'll have to lookup on how to use the $regex operator in the MongoDB documentation. Use the case insensitivity option.)

IV. Modify the prior statement your wrote to find customer documents with David in the name, to return just the _id and name fields.

V. Write a statement that returns a cursor to documents that meet both of the following conditions: customers who have David in their name, and who were born before 1990. Return only the name, birthdate, and _id fields.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a statement that counts the number of documents
Reference No:- TGS03212915

Expected delivery within 24 Hours