In Firebase Firestore I Have a Collection and its corresponding document like
PRODUCTS Document with AutoId Fields: a b I want to check if the field exists or not in that document
Ex- if field a exists some code will execute if not exists some other code will execute if(task.isSuccessful()){ for(long x=0;x<(long)task.getResult().get("no_of_products");x++){ if(task.getResult().get("productID_"+x)==null){ continue; }else{ //some code } } } is this the correct way to check if the field exists in a document or not ?