calling Mongrel to add, update, and delete from the trigger. Works great!
great to hear!
In your experience, is it possible to keep the connection open vs. doing a mongodb:connect/mongodb:close per trigger action?
Sure, you can re-use the mongoClientId for a sequence of commands;
let $mongodbClientId := mongodb:connect($mongoUrl)
It is actually possible to -as long the database is running and the connection is not closed- use the token for all scripts for all users. Just store the clientId/token in a document in the database , and read it from this document for each xquery script.
For sure you might need to think about some potential security risks, but there are no limitations.