https://github.com/plopezgit/sprint2_t4_mongodb_query
MongoDB query syntax
https://github.com/plopezgit/sprint2_t4_mongodb_query
filter mongodb mongodb-query-syntax mongoose-schema
Last synced: 5 months ago
JSON representation
MongoDB query syntax
- Host: GitHub
- URL: https://github.com/plopezgit/sprint2_t4_mongodb_query
- Owner: plopezgit
- Created: 2023-10-25T14:54:18.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-28T18:02:09.000Z (over 2 years ago)
- Last Synced: 2025-06-11T12:49:45.036Z (8 months ago)
- Topics: filter, mongodb, mongodb-query-syntax, mongoose-schema
- Homepage: https://www.mongodb.com/
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sprint2_T4_MongoDB_Query
MongoDB query syntax
We have a collection of Restaurant Objects in New York City, and we need some queries... can you help us?
- [x] {Write a query to display all documents in the Restaurants collection.
- [x] Write a query to display the restaurant_id, name, borough, and cuisine for all documents in the Restaurants collection.
- [x] Write a query to display the restaurant_id, name, borough, and cuisine, but exclude the _id field for all documents in the Restaurants collection.
- [x] Write a query to display restaurant_id, name, borough, and zip code, but exclude the _id field for all documents in the Restaurants collection.
- [x] Write a query to show all the restaurants that are in the Bronx.
- [x] Write a query to show the first 5 restaurants that are in the Bronx.
- [x] Enter a query to display the next 5 restaurants after skipping the first 5 in the Bronx.
- [x] Write a query to find the restaurants that have a score of more than 90.
- [x] Write a query to find restaurants that have a score of more than 80 but less than 100.
- [x] Write a query to find restaurants that are located at a latitude value less than -95.754168.
- [x] Write a MongoDB query to find restaurants that do not serve any 'American' cuisine and have a rating greater than 70 and longitude less than -65.754168.
- [x] Write a query to find the restaurants that do not prepare any 'American' cuisine and got a marker more than 70 and located in the longitude less than -65.754168. Note: Do this query without using the $and operator.
- [x] Enter a query to find restaurants that do not serve any 'American' cuisine and received an 'A' grade point not belonging to Brooklyn. The document should be displayed according to cuisine in descending order.
- [x] Write a query to find the restaurant_id, name, borough, and cuisine for those restaurants that contain 'Wil' as the first three letters in their name.
- [x] Write a query to find the restaurant_id, name, borough, and cuisine for those restaurants that contain 'ces' as the last three letters in their name.
- [x] Write a query to find the restaurant_id, name, borough and cuisine for those restaurants that contain 'Reg' as three letters somewhere in their name.
- [ ] Write a query to find restaurants that belong to the Bronx and prepare any American or Chinese dish.
- [x] Write a query to find the restaurant_id, name, borough, and cuisine for those restaurants that belong to Staten Island or Queens or Bronx or Brooklyn.
- [ ] Write a query to find the restaurant_id, name, borough, and cuisine for those restaurants that are not in Staten Island or Queens or Bronx or Brooklyn.
- [ ] Write a query to find the restaurant_id, name, borough, and cuisine for those restaurants that get a score that is no more than 10.
- [ ] Write a query to find the restaurant_id, name, borough and cuisine for those restaurants that prepare fish except 'American' and 'Chinese' or the restaurant name starts with the letters 'Wil'.
- [ ] Write a query to find the restaurant_id, name, and grades for those restaurants that achieve an "A" grade and a score of 11 on study data ISODate "2014-08-11T00:00:00Z".
- [ ] Write a query to find the restaurant_id, name, and grades for those restaurants where the 2nd grade array element contains a grade of "A" and marker 9 on an ISODate "2014-08-11T00:00:00Z".
- [ ] Write a query to find the restaurant_id, name, address, and geographic location for those restaurants where the second element of the coord array contains a value greater than 42 and up to 52.
- [x] Write a query to arrange the restaurant name in ascending order along with all the columns.
- [x] Write a query to arrange the restaurant name in descending order along with all the columns.
- [ ] Write a query to organize the cuisine name in ascending order and by the same cuisine district. descending order
- [ ] Write a query to find out all the addresses that do not contain the street.
- [ ] Write a query that will select all documents in the restaurants collection where the value of the coord field is Double.
- [ ] Write a query that will select the restaurant_id, name, and grade for those restaurants that return 0 as the remainder after dividing the score by 7.
- [x] Write a query to find the restaurant name, borough, longitude and altitude and cook for those restaurants that contain 'mon' as three letters somewhere in their name.
- [x] Write a query to find the restaurant name, borough, longitude and latitude and cook for those restaurants that contain 'Mad' as the first three letters of their name.