hukusuke1007 / flamingo

[Flutter Library] Flamingo is a firebase firestore model framework library. 🐤
https://pub.dev/packages/flamingo
MIT License
118 stars 20 forks source link

The data type of List being changed to null during update #5

Closed huma11farheen closed 4 years ago

huma11farheen commented 4 years ago

Description: The updated version allows me to deleted all the images from a list but changes the dataType to null due to which further query to add to list cannot be done. The dataType getting changed to null instead of array when all elements of a list are deleted

code snippets :

//in flamingo (UserDocument) writeStorageList(data, "subProfileImages", subProfileImages);

//To fetch user Document final document = await DocumentAccessor() .load<UserDocument>(social.UserDocument(id: userId));

Steps to reproduce:

when updating document.subProfileImages = []

In Firebase: when images are present:

Screenshot 2020-03-31 at 19 45 22

when the entire list is deleted(updated):

Screenshot 2020-03-31 at 19 47 26

subProfileImages becomes null due to which no further query can be made. @hukusuke1007

hukusuke1007 commented 4 years ago

@huma11farheen Thank you for reporting. OK, I'll modify it.

hukusuke1007 commented 4 years ago

@huma11farheen Sorry. Please try to call 'writeStorageListNotNull'.

writeStorageListNotNull(data, "subProfileImages", subProfileImages);

Probably, If use writeStorageListNotNull, it remove a storage field in firestore. Is it expect's result you want?

huma11farheen commented 4 years ago

@hukusuke1007 writeStorageListNotNull(data, "subProfileImages", subProfileImages); i tried this but this deletes the entire subProfileImages entity from firebase

hukusuke1007 commented 4 years ago

@huma11farheen OK, I will modify.

huma11farheen commented 4 years ago

@hukusuke1007 Thank you very much 🙏

hukusuke1007 commented 4 years ago

@huma11farheen I updated. Please check latest version.

huma11farheen commented 4 years ago

@hukusuke1007 Thank you for updating, i will check 👍

huma11farheen commented 4 years ago

@hukusuke1007 Thank you very much, closing the issue