Using retool context in mongodb app name stopped working

For a while now we used the additional connection options in the mongodb resource to send the appName with the current open retool app

This worked as expected, but about 2 weeks ago this stopped working, instead of seeing the app name in our mongodb logs we now see the full string "Retool- {{ retoolContext.appName }}" instead of the result we used to see which was something like "Retool - Companies page"

This makes it incredibly hard to discern where a query is coming from as we have over 20 retools apps

1 Like

Hello @davidl,

  1. Verify Retool Context:
    Ensure that the retoolContext.appName is still valid and accessible in your Retool setup.

  2. Dynamic Query Execution:
    Instead of passing appName in the connection options, include it dynamically in the queries themselves. For example:

const appName = retoolContext.appName || "Unknown App";
db.collection("your_collection").find({ ... }).appName(appName);

5 Likes