How to use `databaseOptions` (and `maxTimeMS` inparticular)

Howdy y’all!

How do I use DatabaseOptions and the maxTimeMS option in particular? The docs are not very descriptive there, or am I missing something?

The maxTimeMS option seems to been implemented in this PR and has been referenced in some topics in this forum (I’m not allowed to post more than 2 links as a newbie… hence I can’t provide references), but I can’t find how to configure it.

Thanks,

Sebastian

I believe you can either pass using databaseOptions in Parse Server initialization or incude ?maxTimeMS=somevalue at the end of your connection string.

Awesome that does the trick:

const api = new ParseServer({
    databaseURI: getDatabaseUri(),
    databaseOptions: {
      maxTimeMS: 10000, // 10sec max query time
    },
    appId: process.env.APP_ID,
    masterKey: process.env.MASTER_KEY,
    fileKey: process.env.FILE_KEY,
    publicServerURL: serverURL,
...