wait for the connection to occur before allowing your application to start listening.  See http://stackoverflow.com/questions/22698661/mongodb-error-setting-ttl-index-on-collection-sessions