Random "findAndModify" operations generated by App Services

Hi everyone,

I have a micro-services application, and I’m migrating it from MongoDB driver to Data API or Custom HTTPS Endpoints to avoid the CPU cost of authenticating every time the micro-service is executed.

In the last days, looking at Atlas Metrics, I noticed that a lot of commands were being executed against the cluster without any major change on the application. Yesterday, the amount of commands was so high that the primary node went down. Looking at the Query Insights -> Query Profiler , there were thousands of findAndModify operations generated by the App Services in different collections that were $set the field _id__baas_transaction and $unset the field _id__stitch_transaction.

I searched for these two fields on the internet and MongoDB documentation, and the only thing that I found was Internal Database Use: Internal Locks. In this page, it’s said that this field is created as a lock when syncing documents and validating its schema.

In my current App Service app, the only things that I’m using and configured are the Data API and HTTPS Custom Endpoints, so there is no reason to sync data between systems or validate document schema.

Does anyone know what could be causing App Services to generate these operations?