title: Bulk Upsert with MongoDB Java 3.0 Driver
body: <p>In the earlier versions of MongoDB Java drivers , to run a query and do unordered bulk upsert on the result all we had do was :</p>
  
  <pre><code>BulkWriteOperation bulk = dbCollection.initializeUnorderedBulkOperation();
      bulk.find(searchQuery).upsert().update(new BasicDBObject("$set", getDbObjectModel()));
  </code></pre>
  
  <p>But in version 3, with the introduction of Bson Document support and MongoCollection.bulkWrite() method how can this be done? </p>
  
  <p>I tried this :</p>
  
  <pre><code>List&lt;WriteModel&lt;Document&gt;&gt; documentList = new ArrayList&lt;&gt;();
  
  collection.bulkWrite(documentList, new BulkWriteOptions().ordered(false));
  </code></pre>
  
  <p>but, I need the upsert functionality.</p>
  
  <p>Thanks.</p>