use mongodb as database and detect ip