com.mongodb.Mongo.createLegacyOptions()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中com.mongodb.Mongo.createLegacyOptions()方法的一些代码示例,展示了Mongo.createLegacyOptions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mongo.createLegacyOptions()方法的具体详情如下:
包路径:com.mongodb.Mongo
类名称:Mongo
方法名:createLegacyOptions

Mongo.createLegacyOptions介绍

暂无

代码示例

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * <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());
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * <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());
}

代码示例来源:origin: org.mongodb/mongodb-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongodb-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongodb-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongodb-driver

/**
 * 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());
}

代码示例来源:origin: org.mongodb/mongodb-driver

/**
 * <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());
}

代码示例来源:origin: org.mongodb/mongodb-driver

/**
 * <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());
}

相关文章