Mongoengine - How to perform a "save new item or increment counter" operation?
You should be able to just do an upsert eg:
ImagesUrl.objects(src=self.src).update_one(
upsert=True,
inc__counter=1,
set__src=self.src)