Filter: {name: "Babelgum"} Projection: {name: 1}
2. All the companies that have more than 5000 employees. Limit the search to 20 companies and sort them by number of employees.
Filter: {number_of_employees: {$gt: 5000}} Sort: {number_of_employees: 1} Limit: 20
3. All the companies founded between 2000 and 2005, both years included. Retrieve only the name
and founded_year
fields.
Filter: {$and: [{founded_year: {$gte: 2000}}, {founded_year: {$lte: 2005}}]} Projection: {name: 1, founded_year: 1}
4. All the companies that had a Valuation Amount of more than 100.000.000 and have been founded before 2010. Retrieve only the name
and ipo
fields.
Filter: {$and: [{"ipo.valuation_amount": {$gt: 1000000}}, {founded_year: {$lte: 2005}}]} Projection: {name: 1, ipo: 1}
5. All the companies that have less than 1000 employees and have been founded before 2005. Order them by the number of employees and limit the search to 10 companies.
Filter: {$and: [{number_of_employees: {$lt: 1000}}, {founded_year: {$lt: 2005}}]} Sort: {number_of_employees: -1} Limit: 10
Filter: {category_code: {$type: 'null'}}
8. All the companies that have at least 100 employees but less than 1000. Retrieve only the name
and number of employees
fields.
Filter: {$and: [{number_of_employees: {$gte: 100}}, {number_of_employees: {$lt: 1000}}]} Projection: {name: 1, number_of_employees: 1}
Sort: {"ipo.valuation_amount": -1}
Sort: {number_of_employees: -1} Limit: 10
11. All the companies founded on the second semester of the year. Limit your search to 1000 companies.
Filter: {$and: [{founded_month: {$gte: 6}}, {founded_month: {$lte: 12}}]} Limit: 1000
Filter: {$and: [{founded_year: {$lt: 2000}}, {"acquisition.price_amount": {$gt: 10000000}}]}
13. All the companies that have been acquired after 2010, order by the acquisition amount, and retrieve only their name
and acquisition
field.
Filter: {"acquisition.acquired_year": {$gt: 2010}} Project: {name: 1, acquisition: 1} Sort: {"acquisition.price_amount": -1}
Projection: {name: 1, founded_year: 1} Sort: {founded_year: -1}
15. All the companies that have been founded on the first seven days of the month, including the seventh. Sort them by their acquisition price
in a descending order. Limit the search to 10 documents.
Filter: {$and: [{founded_day: {$gte: 0}}, {founded_day: {$lte: 7}}]} Sort: {number_of_employees: -1} Limit: 10