Understanding the Server Object

The MongoClient connection utilizes a Server object in the background. This object defines how the MongoDB driver should connect to the server. The Server object contains information such as the host, port, pool size, and socket timeout values used when creating the connection.

You do not need to interact directly with the Server object, but you need to specify the options used to create it for the client connection. Table 13.2 lists the most important options you can set when defining the Server object:

Image

Table 13.2 Options used to create the Server object for a MongoClient connection

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.247.68