updating mongo demo code