I have multiple document. My problem is that I am not able to get the particular data which modified, I am getting full documentions.
db.collection("employees").whereEqualTo("OID", OID)
.addSnapshotListener(new EventListener<QuerySnapshot>() {
@Override
public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots, @Nullable FirebaseFirestoreException e) {
if (e != null) {
Log.w(TAG, "listen:error", e);
return;
}
for (DocumentChange dc : snapshots.getDocumentChanges()) {
switch (dc.getType()) {
case ADDED:
//Here i am getting full newly added documents
break;
case MODIFIED:
//here i am getting which is modified document,ok fine...,But i want to get only the filed which i modified instance of getting full documents..
break;
case REMOVED:
break;
}
}
}
});
Note:
case MODIFIED: here i am getting which is modified of full document, which works fine. But I want to get only the field that I modified instead of getting all the fields from documents.
Take look of above screenshot
For example
If I change the field isActive=true into isActive=false then I want to get the particular filed only.,, I don't want the remaining all fields...(OR) How to identify which field is changed.