Logging sensor values to mongdb