Java com.mongodb Mongo fields, constructors, methods, implement or subclass

Example usage for Java com.mongodb Mongo fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.mongodb Mongo.

The text is from its open source code.

Subclass

com.mongodb.Mongo has subclasses.
Click this link to see all its subclasses.

Constructor

Mongo(final String host, @SuppressWarnings("deprecation") final MongoOptions options)
Creates a Mongo instance based on a (single) mongodb node (default port)
Mongo(final String host, final int port)
Creates a Mongo instance based on a (single) mongodb node
Mongo(final ServerAddress address, @SuppressWarnings("deprecation") final MongoOptions options)
Creates a Mongo instance based on a (single) mongo node using a given ServerAddress
Mongo(final ServerAddress left, final ServerAddress right)

Creates a Mongo in paired mode.

Mongo(final List seeds, @SuppressWarnings("deprecation") final MongoOptions options)

Creates an instance based on a list of replica set members or mongos servers.

Mongo(final List seedList, final MongoClientOptions options)
Mongo(final ServerAddress serverAddress, final MongoClientOptions options)
Mongo(final MongoClientURI mongoURI, @Nullable final MongoDriverInformation mongoDriverInformation)
Mongo(final String host)
Creates a Mongo instance based on a (single) mongodb node (default port)
Mongo(final ServerAddress address)
Creates a Mongo instance based on a (single) mongodb node
Mongo(final List seeds)

Creates an instance based on a list of replica set members or mongos servers.

Mongo(@SuppressWarnings("deprecation") final MongoURI uri)

Creates a Mongo described by a URI.

Mongo(final MongoClientURI mongoURI)
Mongo()
Creates a Mongo instance based on a (single) mongodb node (localhost, default port)
Mongo(final ServerAddress left, final ServerAddress right, @SuppressWarnings("deprecation") final MongoOptions options)

Creates a Mongo connection in paired mode.

Mongo(final ServerAddress serverAddress, final List credentialsList, final MongoClientOptions options)
Mongo(final List seedList, final List credentialsList, final MongoClientOptions options)
Mongo(final Cluster cluster, final MongoClientOptions options, final List credentialsList)

Method

voidclose()
Closes all resources associated with this instance, in particular any open network connections.
voiddropDatabase(final String dbName)
Drops the database if it exists.
ServerAddressgetAddress()
Gets the address of the current master
StringgetConnectPoint()
Gets a String representation of current connection point, i.e.
ListgetDatabaseNames()
Gets a list of the names of all databases on the connected server.
DBgetDB(final String dbName)
Gets a database object.
ListgetServerAddressList()
Gets the list of server addresses currently seen by this client.
voidsetReadPreference(final ReadPreference readPreference)
Sets the default read preference to use for reads operations executed on any DBCollection created indirectly from this instance, via a DB instance created from #getDB(String) .
voidsetWriteConcern(final WriteConcern writeConcern)
Sets the default write concern to use for write operations executed on any DBCollection created indirectly from this instance, via a DB instance created from #getDB(String) .
voidslaveOk()
Makes it possible to run read queries on secondary nodes