title: How To Configure MongoDb Collection Name For a Class in Spring Data
body: <p>I have a collection called <code>Products</code> in my MongoDB database, which is represented by the interface <code>IProductPrice</code> in my Java code. The following repository declaration causes Spring Date to look to the collection <code>db.collection: Intelliprice.iProductPrice</code>.</p>
  
  <p>I want it to configure it to look in <code>db.collection: Intelliprice.Products</code> using an external configuration rather than putting an <code>@Collection(..)</code> annotation on <code>IProductPrice</code>. Is this possible? How can I do this?</p>
  
  <pre><code>public interface ProductsRepository extends
      MongoRepository&lt;IProductPrice, String&gt; {
  }
  </code></pre>