What is the assert in the mongodb4.0.3 official connection example?

I"m not sure what assert is. Which god will answer it?

here is an example of a connection to an official document

const MongoClient = require("mongodb").MongoClient;
const assert = require("assert");

// Connection URL
const url = "mongodb://localhost:27017";

// Database Name
const dbName = "myproject";

// Create a new MongoClient
const client = new MongoClient(url);

// Use connect method to connect to the Server
client.connect(function(err) {
  assert.equal(null, err);
  console.log("Connected successfully to server");

  const db = client.db(dbName);

  client.close();
});


Sep.16,2021

assertion library, assert.equal (null, err) means that when err sometimes, it will directly throw the wrong


this is the knowledge of NodeJS. Reference documentation: https://nodejs.org/api/assert.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b47306-2c874.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b47306-2c874.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?