Exports mongoose just if gets connection