python util for  generating mongo's document.