title: Springboot With Mongodb Error while using find*() query
body: <p>I am getting the following error:</p>
  
  <blockquote>
    <p>at com.aks.springStorage.SpringStorageApplication.main(SpringStorageApplication.java:22) [classes/:na]<br>
    Caused by: org.springframework.data.mongodb.UncategorizedMongoDbException: Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "company" }' on server localhost:27017; nested exception is com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "company" }' on server localhost:27017</p>
  </blockquote>
  
  <p>Strange thing is I am not using any variable like "locale" in company collection.  I am able to insert and able to get the count, but none of the findAll* are
   working, getting the same error.</p>
  
  <pre><code>public interface CompanyRepository extends MongoRepository&lt;Company, String&gt; {
      List&lt;Company&gt; findByName(String name);
  
      @Query("{'contact.address': ?0}")
      List&lt;Company&gt; findByAddress(String address);
  }
  
  @Document(collation = "company")
  public class Company {
      private int id;
      private String name;
      private List&lt;Product&gt; products;
      private Contact contact;
  
      public Company(int id, String name, List&lt;Product&gt; products, Contact contact) {
          this.id = id;
          this.name = name;
          this.products = products;
          this.contact = contact;
      }
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public List&lt;Product&gt; getProducts() {
          return products;
      }
  
      public void setProducts(List&lt;Product&gt; products) {
          this.products = products;
      }
  
      public Contact getContact() {
          return contact;
      }
  
      public void setContact(Contact contact) {
          this.contact = contact;
      }
  }
  
  // Client code:      
  //this is working fine
  int count = (int) companyRepo.count();
  
  // Failing Here
  companies = companyRepo.findByName("yy");
  </code></pre>