title: Write Spring Data Mongo Null query to get NULL documents from mongo?
body: <p>I am developing <code>Spring + Spring Data Mongo</code> example. In this example I'd like to get document where <code>Region is NULL</code>. For this I developed Repository method</p>
  
  <pre><code>List&lt;Customer&gt; findByRegionNull();
  </code></pre>
  
  <p>database query shows capital <strong>NULL</strong> and not <strong>Null</strong>, Now when <strong>db.customers.find({ "Region" :  "null" });</strong> query execute I don't see any results. <strong>How we can write repository query to get NULL?</strong></p>
  
  <pre><code>    db.customers.find({ "Region" :  "NULL" });
      {
          "_id" : ObjectId("51ba0970ae4ad8cc43bb95e3"),
          "CustomerID" : "ALFKI",
          "CompanyName" : "Alfreds Futterkiste",
          "ContactName" : "Maria Anders",
          "ContactTitle" : "Sales Representative",
          "Address" : "Obere Str. 57",
          "City" : "Berlin",
          "Region" : "NULL",
          "PostalCode" : 12209,
          "Country" : "Germany",
          "Phone" : "030-0074321",
          "Fax" : "030-0076545"
      }
      {
      "_id" : ObjectId("51ba0970ae4ad8cc43bb95e4"),
      "CustomerID" : "ANATR",
      "CompanyName" : "Ana Trujillo Emparedados y helados",
      "ContactName" : "Ana Trujillo",
      "ContactTitle" : "Owner",
      "Address" : "Avda. de la Constitución 2222",
      "City" : "México D.F.",
      "Region" : "NULL",
      "PostalCode" : 5021,
      "Country" : "Mexico",
      "Phone" : "(5) 555-4729",
      "Fax" : "(5) 555-3745"
  }
  </code></pre>
  
  <p>The code I developed:
  CustomerRepository.java</p>
  
  <pre><code>   public interface CustomerRepository extends CrudRepository&lt;Customer, String&gt;{
          List&lt;Customer&gt; findByRegionNull();
      }
  </code></pre>
  
  <p>My Test case Doesnot give results?</p>
  
  <pre><code>@Test
      public void testRegionNull(){
          List&lt;Customer&gt; customers =cService.findByRegionNull(); 
          LOGGER.debug("SIZE : "+customers.size());
      }
  </code></pre>
  
  <p>Customer.java</p>
  
  <pre><code>@Document(collection="customers")
  public class Customer {
      @Id
      private ObjectId id;
  
      @Field("CustomerID")
      private String customerId;
  
      @Field("CompanyName")
      private String companyName;
  
      @Field("ContactName")
      private String contactName;
  
      @Field("ContactTitle")
      private String contactTitle;
  
      @Field("Address")
      private String address;
  
      @Field("City")
      private String city;
  
      @Field("Region")
      private String region;
  
      @Field("PostalCode")
      private String postalCode;
  
      @Field("Country")
      private String country;
  
      @Field("Phone")
      private String phone;
  
      @Field("Fax")
      private String fax;
      // setters and getters
  }
  </code></pre>