old_contents: #!/usr/bin/env python
  """ Your task is to write a query that will return all cities
  that are founded in 21st century.
  Please modify only 'range_query' function, as only that will be taken into account.
  
  Your code will be run against a MongoDB instance that we have provided.
  If you want to run this code locally on your machine,
  you have to install MongoDB, download and insert the dataset.
  For instructions related to MongoDB setup and datasets please see Course Materials.
  """
  from datetime import datetime
      
  def get_db():
      from pymongo import MongoClient
      client = MongoClient('localhost:27017')
      db = client.examples
      return db
  
  
  def range_query():
      # You can use datetime(year, month, day) to specify date in the query
      query = {}
      return query
  
  
  if __name__ == "__main__":
  
      db = get_db()
      query = range_query()
      cities = db.cities.find(query)
  
      print "Found cities:", cities.count()
      import pprint
      pprint.pprint(cities[0])
  
new_contents: #!/usr/bin/env python
  """ Your task is to write a query that will return all cities
  that are founded in 21st century.
  Please modify only 'range_query' function, as only that will be taken into account.
  
  Your code will be run against a MongoDB instance that we have provided.
  If you want to run this code locally on your machine,
  you have to install MongoDB, download and insert the dataset.
  For instructions related to MongoDB setup and datasets please see Course Materials.
  """
  from datetime import datetime
  
  
  def get_db():
      from pymongo import MongoClient
  
      client = MongoClient('localhost:27017')
      db = client.examples
      return db
  
  
  def range_query():
      # You can use datetime(year, month, day) to specify date in the query
      query = {'foundingDate': {"$gte": datetime(2001, 1, 1)}}
      return query
  
  
  if __name__ == "__main__":
      db = get_db()
      query = range_query()
      cities = db.cities.find(query)
  
      print "Found cities:", cities.count()
  
subject: Add solution for Lesson_4.18-Range_Queries.