Sharding with spring mongo
<p>I'm using mongoDB for storing and querying close to 50 mn records (Large Json files with no fixed schema), through a spring web application. Simple K-V pair based find queries run into a few seconds. I'm looking at ways to bring search time down to &lt; 1s. </p>

<p>Indexing doesn't work for me because of the nature of the files stored. I was looking at alternatives and came across sharding. However, I found no good tutorial explaining how to set up sharding for my existing spring-mongo application.</p>

<p>Can someone please point me towards a good explanation for the same? 
Also any other suggestions for optimizing search time would be welcome!</p>

<p><strong>EDIT</strong></p>

<p>Following the comment, I converted my existing Mongo database into a sharded one with 1 config server, 1 query server and 2 shards. Previously my (spring-boot) application.properties file looked like this :</p>

<pre><code>...
spring.data.mongodb.database=pam
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.repositories.enabled=true
spring.data.mongodb.uri=mongodb://localhost:27017/pam
...
</code></pre>

<p>How do I modify it now to adapt to the sharded database, with the same name?</p>