title: Creating a MongoDB View using the Java driver
body: <p>How do I create a view in mongo db which can expose all the documents from a collection? I have used following code: </p>
  
  <pre><code>java.util.List&lt;Bson&gt; tstL = new ArrayList&lt;&gt;();
  db.createView("tst_view","collection_name",tstL);
  </code></pre>
  
  <p>I am trying it with empty list for pipeline but it doesn't work. Can you please help? </p>