-
Type: Task
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Native
-
Labels:None
-
(copied to CRM)
-
Empty show more show less
GridStore fails to store a file depending on the combination of "retryWrites" configuration and the existence of the collection.
const gs = new GridStore(_self.myDB, fileId, filepath, "w", {root: "defaultimages", metadata: {_CompanyID: _CompanyID}});
In that line we are defining defaultimages as the collection to store the data, so the chunks will be in defaultimages.chunks. If the collection doesn't exist, the driver should create it automatically.
I have found that it will work or fail depending on the combination of retryWrites configuration and the existence of defaultimages collection:
- If you are using retryWrites=true and the collection doesn't exist, the driver won't create it and the NodeJS app will fail.
- If you are not using retryWrites=true and the collection doesn't exist, the driver will be able to create the collection and it will work as expected.
- If the collection already exists, doesn't matter what value you have in retryWrites, it will always work.