How to delete mongodb document with two conditions one with $gt operator?
<p>I would like to retrieve the following information:</p>

<pre><code>delete from database where name = 'AAA' and age&gt;20;
</code></pre>

<p>but for MongoDB in Java. Essentially, it should delete the document that contain the word <code>AAA</code> and age greater than 20 in them. I know that there is the <code>$in</code> operator in MongoDB, but how do I do the same in Java, using the Java driver? I've been trying to look for it everywhere but am getting nothing. I've tried:</p>

<pre><code>query = new BasicDBObject("age", new BasicDBObject("$gt", "20"), new BasicDBObject("name", "AAA"));
</code></pre>

<p>JSON which i want to delete is like this.</p>

<pre><code>{"school" : "NewSchool" , "name" : "AAA" , "age" : "50"}
</code></pre>