[Nc-Net] Added undef LOG_DEBUG for new mongodb version.
Added try/catch on query to print more information on errors.