title: Firebase onDatachange() to set value
body: <p>Is it possible to set the value using onDataChange() in Firebase? I do not know the value of the post key of each child.</p>
  <p><a href="https://i.stack.imgur.com/fFN67.jpg" rel="nofollow noreferrer">Posts database</a></p>
  <pre><code>databaseReference2 = firebaseDatabase.getReference(&quot;Posts&quot;);
  
  Query query2 = databaseReference2.orderByChild(&quot;userID&quot;).equalTo(currentUser.getUid());
  
  query2.addValueEventListener(new ValueEventListener() {
  @Override
  public void onDataChange(@NonNull @NotNull DataSnapshot snapshot) {
  for(DataSnapshot snap:snapshot.getChildren())
        {
         Post post = snap.getValue(Post.class);
         post.setPicture(image);
         post.setUserName(name);
        }
       }  
  @Override
  public void onCancelled(@NonNull @NotNull DatabaseError error) {
      
       }
     });
  </code></pre>