Return autoincrement id flask

I have followed the tutorial to create a collection counters with a trigger to autoincrement an id (i gave number fileId). I’m using flask api. It’s possible to return the number of fileId after insert a document?