title: AttributeError: 'CollectionReference' object has no attribute 'stream'
body: <p>I am looking at reading information from firestore. So I followed the examples from <a href="https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/firestore/cloud-client/snippets.py" rel="nofollow noreferrer">here</a>. Here is my code. It's a Flask application which calls the firestore client. </p>
  
  <pre><code>@menuapi_routes.route("/api/menu")
  def get_menus():
      menu_items = get_menu_items()
      retval = []
      for item in menu_items.stream():
          retval.append(u' {} =&gt; {}'.format(item.id, item.to_dict()))
      return json.dumps(retval)
  </code></pre>
  
  <p>The code which is getting called is. </p>
  
  <pre><code>def get_menu_items():
      db = firestore.Client()
      doc_ref = db.collection(u'menus')
      return doc_ref
  </code></pre>
  
  <p>The error I get is </p>
  
  <pre><code>127.0.0.1 - - [16/May/2020 22:09:24] "GET / HTTP/1.1" 404 -
  [2020-05-16 22:09:34,236] ERROR in app: Exception on /api/menu [GET]
  Traceback (most recent call last):
    File "\venv\lib\site-packages\flask\app.py", line 2447, in wsgi_app
      response = self.full_dispatch_request()
    File "\venv\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "\venv\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
      raise value
    File "\venv\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
      rv = self.dispatch_request()
    File "\venv\lib\site-packages\flask\app.py", line 1936, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "\app\api\menu\menu.py", line 13, in get_menus
      for item in menu_items.stream():
  AttributeError: 'CollectionReference' object has no attribute 'stream'
  Exception on /api/menu [GET]
  Traceback (most recent call last):
    File "\venv\lib\site-packages\flask\app.py", line 2447, in wsgi_app
      response = self.full_dispatch_request()
    File "\venv\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "\venv\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
      raise value
    File "\venv\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
      rv = self.dispatch_request()
    File "\venv\lib\site-packages\flask\app.py", line 1936, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "\app\api\menu\menu.py", line 13, in get_menus
      for item in menu_items.stream():
  AttributeError: 'CollectionReference' object has no attribute 'stream'
  Exception on /api/menu [GET]
  Traceback (most recent call last):
    File "\venv\lib\site-packages\flask\app.py", line 2447, in wsgi_app
      response = self.full_dispatch_request()
    File "\venv\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "\venv\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
      raise value
    File "\venv\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
      rv = self.dispatch_request()
    File "\venv\lib\site-packages\flask\app.py", line 1936, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "\app\api\menu\menu.py", line 13, in get_menus
      for item in menu_items.stream():
  AttributeError: 'CollectionReference' object has no attribute 'stream'
  127.0.0.1 - - [16/May/2020 22:09:34] "GET /api/menu HTTP/1.1" 500 -
  </code></pre>