connect() (mongosh method方法) | Connects to a MongoDB instance and to a specified database on that instance.连接到MongoDB实例和该实例上的指定数据库。 |
Mongo() | Creates a new connection object.创建新的连接对象。 |
Mongo.getDB() | Returns a database object.返回一个数据库对象。 |
Mongo.getDBNames() | Returns a list of databases.返回数据库列表。 |
Mongo.getDBs() | Returns a document with a list of databases and metadata.返回一个包含数据库和元数据列表的文档。 |
Mongo.getReadPrefMode() | Returns the current read preference mode for the MongoDB connection.返回MongoDB连接的当前读取首选项模式。 |
Mongo.getReadPrefTagSet() | Returns the read preference tag set for the MongoDB connection.返回为MongoDB连接设置的读取首选项标记。 |
Mongo.getURI() | Returns the connection string for the current active connection.返回当前活动连接的连接字符串。 |
Mongo.getWriteConcern() | Returns the write concern for the connection object.返回连接对象的写入关注。 |
Mongo.setCausalConsistency() | Enables or disables causal consistency on the connection object.启用或禁用连接对象上的因果一致性。 |
Mongo.setReadPref() | Sets the read preference for the MongoDB connection.设置MongoDB连接的读取首选项。 |
Mongo.setWriteConcern() | Sets the write concern for the connection object.设置连接对象的写入关注。 |
Mongo.startSession() | Starts a session on the connection object.在连接对象上启动会话。 |
Mongo.watch() | Opens a change stream cursor for a deployment to report on all its non-system collections across all its databases, excluding the internal admin, local, and config databases.打开部署的更改流游标,以报告其所有数据库中的所有非system集合,不包括内部admin、local和config数据库。 |
Session() | The session object.会话对象。 |
SessionOptions() | The options object for the session.会话的选项对象。 |