title: Performing update using @Query via Spring Data MongoDB
body: <p>i wanted to do a direct update to mongodb and setting <code>someflag</code> to either true or false for my use case. To be effecient i do not want to query all documents and set the <code>someflag</code> and save it back to db. i just want to directly update it on db just like when doing update on mongodb terminal.</p>
  <p>Here is the sample document. NOTE: these documents can number from 1 ~ N so i need to handle efficiently big datas</p>
  <pre><code>{
    _id: 60db378d0abb980372f06fc1
    someid: 23cad24fc5d0290f7d5274f5
    somedata: some data of mine
    flag: false
  }
  </code></pre>
  <p>Currently im doing an <code>@Query</code> method on my repository</p>
  <pre><code>@Query(value =&quot;{someid: ?0}, {$set: {flag: false}}&quot;)
  void updateFlag(String someid)
  </code></pre>
  <p>Using the above syntax, it doesnt work, i always get an exception message below;</p>
  <blockquote>
  <p>Failed to instantiate void using constructor NO_CONSTRUCTOR with
  arguments</p>
  </blockquote>
  <p>How do i perform a direct update effeciently without querying all those document and updating it back to db?</p>