Here is the trigger function code, where I expect to see record inserted into history_col after I do some inserts to tpayer collection. But nothing inserted to history_col after the inserts.
exports = function(changeEvent) {
const fullDoc = changeEvent.fullDocument;
const updateDescription = changeEvent.updateDescription;
const mongodb = context.services.get("Cluster20434");
const db = mongodb.db("test");
if (changeEvent.operationType == "insert") {
db.collection("history_col").insertOne({"operation": changeEvent.operationType, "Full Document": fullDoc})
.then(result => console.log("Inserted"));
return result;
}
};