Hi Please find the structure of firebase DB?

[![enter image description here](https://i.stack.imgur.com/60ioV.png)](https://i.stack.imgur.com/60ioV.png)

Now let's say, we want to update **fName** and **lName** from **-LcKJ14wv-Y46QER1V-
0**

How to update them so only these values are updated and **no new values are added** in the database?

**Code we have written**

```
queryToGetData = FirebaseDatabase.getInstance().getReference().child(AppData.STUDENTS)
                    .orderByChild("studentUnique").equalTo(user.getUid()).limitToFirst(1);
            queryToGetData.addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {

                    if(!dataSnapshot.exists()){
                        db.push().setValue(ss);
                        Common.alertDialog("Added","Profile Details saved", StudentProfile.this);
                    } else {
                        db.setValue(ss);
                        Common.alertDialog("Oops","Profile Updated", StudentProfile.this);
                    }
                }
                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Common.alertDialog("Oops","Something went wrong!", StudentProfile.this);
                }
            });

```

**What this piece of code is doing?**

*when running update for the first time(the whole collection is empty)*

[![enter image description here](https://i.stack.imgur.com/OKWRj.png)](https://i.stack.imgur.com/OKWRj.png)

\*when running update for the second time(same user)

[![enter image description here](https://i.stack.imgur.com/RoO5d.png)](https://i.stack.imgur.com/RoO5d.png)

*when running update for the third time(same user)*

[![enter image description here](https://i.stack.imgur.com/zd4ls.png)](https://i.stack.imgur.com/zd4ls.png)