Escaping {{ and or }} in value for mongo

Hi there
I have a few config records in a mongo database that is stored as the following example:
{
“Config1”: " “https://{{hostDomain}}/configservice/{{featureCat1}}/”,
“Config2”: " “https://{{hostDomain}}/configservice/{{featureCat2}}/”,
},
What seems to happen when i update this in the database via a query, it gets converted to:
{
“Config1”: " “https://null/configservice/null/”,
“Config2”: " “https://null/configservice/null/”,
},

What I suspect is happening is that the appsmith application is recognizing the {{}} and looking for a local variable.
How would I go about escaping the {{ and }} to maintain the correct values in the config?

Hi Elroy,

To fix this issue, please add double-quotes around the values in your MongoDB query (like this: "{{this.params.myValue}}") and turn OFF Smart BSON Substitution in your query Settings.
image

Hi Amelia, I have tried the above and it works. However it only works on update statements.
If I use insert statements I get a Execution failed with status 5005, documents could not be parsed into the expected JSON Array format. If I turn Smart BSON Substitution on, the insert works, however it then replaces the values with nulls as above. Could you please assist, thank you.

Can you share a screenshot of your insert query and of the original error?

Hi Amelia, I have dm’d you the project that I have demonstrated the issue with,