title: Get value from array in mongodb collection
body: <pre><code>collection:
  {    
      &quot;username&quot; : &quot;gorim99949@x1post.com&quot;,
      &quot;channels&quot; : [ 
          {
              &quot;channelName&quot; : &quot;yyyyy&quot;,
              &quot;id&quot; : 383,
              &quot;url&quot; : &quot;https://xxxxxxxxx&quot;,
          }
      ],
  }
  
  @Document(collection = &quot;user_masters&quot;)
  public class UserMasters {
    @Field(&quot;username&quot;)
    private String userName;
  
    @DBRef
    private List&lt;UserChannels&gt; UserChannels userChannels;
     ******getter and setter*********
  
  @Document(collection=&quot;channels&quot;)
  public class UserChannels {
    private String url;
   ************getter/setter****************
  
  
  Repository class
  public UserMasters  findByUserName(String username);
  
  @Test method
  Query: userRepository.findByUserName(userName).getUserChannels().getUrl();
  </code></pre>
  <p>how can i get value of url from array in the collection in mongodb. I am unable to read values in the array in the collection. thanks in advance for your help</p>