/** * Creates a Mongo instance based on a (single) mongodb node * * @param address the database address * @see com.mongodb.ServerAddress * @deprecated Replaced by {@link MongoClient#MongoClient(ServerAddress)} */ @Deprecated public Mongo(final ServerAddress address) { this(address, createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node * * @param host the host address of the database * @param port the port on which the database is running * @deprecated Replaced by {@link MongoClient#MongoClient(String, int)} */ @Deprecated public Mongo(final String host, final int port) { this(new ServerAddress(host, port), createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node (localhost, default port) * * @throws MongoException if there's a failure * @deprecated Replaced by {@link MongoClient#MongoClient()}) */ @Deprecated public Mongo() { this(new ServerAddress(), createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node (default port) * * @param host server to connect to * @deprecated Replaced by {@link MongoClient#MongoClient(String)} */ @Deprecated public Mongo(final String host) { this(new ServerAddress(host), createLegacyOptions()); }
/** * <p>Creates a Mongo in paired mode. </p> * * <p>This will also work for a replica set and will find all members (the master will be used by default).</p> * * @param left left side of the pair * @param right right side of the pair * @see com.mongodb.ServerAddress * @deprecated Please use {@link MongoClient#MongoClient(java.util.List)} instead. */ @Deprecated public Mongo(final ServerAddress left, final ServerAddress right) { this(asList(left, right), createLegacyOptions()); }
/** * <p>Creates an instance based on a list of replica set members or mongos servers. For a replica set it will discover all members. * For a list with a single seed, the driver will still discover all members of the replica set. For a direct * connection to a replica set member, with no discovery, use the {@link #Mongo(ServerAddress)} constructor instead.</p> * * <p>When there is more than one server to choose from based on the type of request (read or write) and the read preference (if it's a * read request), the driver will randomly select a server to send a request. This applies to both replica sets and sharded clusters. * The servers to randomly select from are further limited by the local threshold. See * {@link MongoClientOptions#getLocalThreshold()}</p> * * @param seeds Put as many servers as you can in the list and the system will figure out the rest. This can either be a list of mongod * servers in the same replica set or a list of mongos servers in the same sharded cluster. * @see MongoClientOptions#getLocalThreshold() * @deprecated Replaced by {@link MongoClient#MongoClient(java.util.List)} */ @Deprecated public Mongo(final List<ServerAddress> seeds) { this(seeds, createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node * * @param address the database address * @see com.mongodb.ServerAddress * @deprecated Replaced by {@link MongoClient#MongoClient(ServerAddress)} */ @Deprecated public Mongo(final ServerAddress address) { this(address, createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node * * @param host the host address of the database * @param port the port on which the database is running * @deprecated Replaced by {@link MongoClient#MongoClient(String, int)} */ @Deprecated public Mongo(final String host, final int port) { this(new ServerAddress(host, port), createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node (localhost, default port) * * @throws MongoException if there's a failure * @deprecated Replaced by {@link MongoClient#MongoClient()}) */ @Deprecated public Mongo() { this(new ServerAddress(), createLegacyOptions()); }
/** * Creates a Mongo instance based on a (single) mongodb node (default port) * * @param host server to connect to * @deprecated Replaced by {@link MongoClient#MongoClient(String)} */ @Deprecated public Mongo(final String host) { this(new ServerAddress(host), createLegacyOptions()); }
/** * <p>Creates a Mongo in paired mode. </p> * * <p>This will also work for a replica set and will find all members (the master will be used by default).</p> * * @param left left side of the pair * @param right right side of the pair * @see com.mongodb.ServerAddress * @deprecated Please use {@link MongoClient#MongoClient(java.util.List)} instead. */ @Deprecated public Mongo(final ServerAddress left, final ServerAddress right) { this(asList(left, right), createLegacyOptions()); }
/** * <p>Creates an instance based on a list of replica set members or mongos servers. For a replica set it will discover all members. * For a list with a single seed, the driver will still discover all members of the replica set. For a direct * connection to a replica set member, with no discovery, use the {@link #Mongo(ServerAddress)} constructor instead.</p> * * <p>When there is more than one server to choose from based on the type of request (read or write) and the read preference (if it's a * read request), the driver will randomly select a server to send a request. This applies to both replica sets and sharded clusters. * The servers to randomly select from are further limited by the local threshold. See * {@link MongoClientOptions#getLocalThreshold()}</p> * * @param seeds Put as many servers as you can in the list and the system will figure out the rest. This can either be a list of mongod * servers in the same replica set or a list of mongos servers in the same sharded cluster. * @see MongoClientOptions#getLocalThreshold() * @deprecated Replaced by {@link MongoClient#MongoClient(java.util.List)} */ @Deprecated public Mongo(final List<ServerAddress> seeds) { this(seeds, createLegacyOptions()); }