sample code for mongodb