Exercises
Exercise 1
Create a geospatial index (2dsphere) for the states collection
Get information on states collection’s indexes
Remove the geospatial index from the states collection
Get information on states collection’s indexes
Exercise 2
Use the restaurant collection in the geo database
Create a valid query and print the query plan using executionStats•Find documents between '10200‘ and '10280‘ in zipcode
Create an index to zipcode (Hint: Embedded Document)
Execute #1, again.
No Index
Indexed
Use the restaurant collection in the geo database
Create a query and print the query plan using executionStats•Find documents that have at least the grade is ‘B’ in the grades.grade field.
Create an index to grade (Hint: Indexing on Array)
Execute #1, again.
No Index
Indexed
Exercise 3
Find international airports in the state that has the above zip code (10044)
Sorting the name in ascending order
Print state’s name and airport name each.
Hint: states and small_zip collections
Find Korean restaurants that are located at less 2km from international airports.
Warn: should create 2dsphere index to address for restaurants collection.
Find states that are intersect to the flight path (trajectory).
Print names including source and destination states.
Make Geojson format whose type is LineString.
Find the two coordinates (LAX, DTW) Result
Result
Exercise 4
Using the restaurants collection.
Find restaurants whose names include "Kimchi".
Print only name, zipcodeand address
Using the restaurants and states collections.
Find restaurants that have "NolbuRestaurant"(restaurants collection)
Print the state (states collection)
Using restaurants.json
Among the "Korean" restaurants, find a restaurant that has "Ramen"but "Izakaya“.
Then, find a restaurant near above restaurant in 150m.
Last updated