Facing confilct of document path UpdateDocument and AppendMapValueArray #191
Replies: 2 comments
-
The document path parameter of The document path parameter of If unencoded document paths are the same, you will get your desire result based on the methods you are using unless human error in your code which you have to check. |
Beta Was this translation helpful? Give feedback.
-
Thank you man ... resolved it |
Beta Was this translation helpful? Give feedback.
-
Hey , hii I am using the latest 1.4.11 version of FirebaseClient .
The issue I am facing is , when I replace whitespaces in my document name with "%20" and run the UpdateDocument and AppendMapValueArray in a same sketch targeting to update a single document , two documents are created . One has all of the details I provided in the UpdateDocument request and another has the data about the Array of maps .
In order to solve it , I did
String documentNameOrig = documentName;
String dateTime = getLocalTime();
documentName.replace(" ", "%20");
String documentPathForUpdateQuery = COLLECTION_PATH + documentName;
String documentPathForAppendMapValueArray = COLLECTION_PATH + documentNameOrig;
And then i use the
documentPathForUpdateQuery
for myDocs.patch
for UpdateDocument , anddocumentPathForAppendMapValueArray
for myDocumentTransform transform(documentPathForAppendMapValueArray, fieldTransforms);
.Please guide if I am doing it in a wrong way and if there is a correct method please help .
Beta Was this translation helpful? Give feedback.
All reactions