You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains the officially supported MongoDB Rust driver, a client side library that can be used to interact with MongoDB deployments in Rust applications. It uses the [`bson`](https://docs.rs/bson/2.0.0-beta.1) crate for BSON support. The driver contains a fully async API that supports either [`tokio`](https://crates.io/crates/tokio) (default) or [`async-std`](https://crates.io/crates/async-std), depending on the feature flags set. The driver also has a sync API that may be enabled via feature flag.
4
+
This repository contains the officially supported MongoDB Rust driver, a client side library that can be used to interact with MongoDB deployments in Rust applications. It uses the [`bson`](https://docs.rs/bson/2.0.0-beta.2) crate for BSON support. The driver contains a fully async API that supports either [`tokio`](https://crates.io/crates/tokio) (default) or [`async-std`](https://crates.io/crates/async-std), depending on the feature flags set. The driver also has a sync API that may be enabled via feature flag.
5
5
6
6
## Index
7
7
-[Installation](#installation)
@@ -38,7 +38,7 @@ issue. For more information, see https://github.com/rust-lang/rust/issues/75992.
38
38
The driver is available on [crates.io](https://crates.io/crates/mongodb). To use the driver in your application, simply add it to your project's `Cargo.toml`.
39
39
```toml
40
40
[dependencies]
41
-
mongodb = "2.0.0-beta.1"
41
+
mongodb = "2.0.0-beta.2"
42
42
```
43
43
44
44
#### Configuring the async runtime
@@ -47,7 +47,7 @@ The driver supports both of the most popular async runtime crates, namely [`toki
47
47
For example, to instruct the driver to work with [`async-std`](https://crates.io/crates/async-std), add the following to your `Cargo.toml`:
48
48
```toml
49
49
[dependencies.mongodb]
50
-
version = "2.0.0-beta.1"
50
+
version = "2.0.0-beta.2"
51
51
default-features = false
52
52
features = ["async-std-runtime"]
53
53
```
@@ -56,14 +56,14 @@ features = ["async-std-runtime"]
56
56
The driver also provides a blocking sync API. To enable this, add the `"sync"` feature to your `Cargo.toml`:
57
57
```toml
58
58
[dependencies.mongodb]
59
-
version = "2.0.0-beta.1"
59
+
version = "2.0.0-beta.2"
60
60
default-features = false
61
61
features = ["sync"]
62
62
```
63
63
**Note:** if the sync API is enabled, the async-specific types will be privatized (e.g. `mongodb::Client`). The sync-specific types can be imported from `mongodb::sync` (e.g. `mongodb::sync::Client`).
64
64
65
65
## Example Usage
66
-
Below are simple examples of using the driver. For more specific examples and the API reference, see the driver's [docs.rs page](https://docs.rs/mongodb/2.0.0-beta.1).
66
+
Below are simple examples of using the driver. For more specific examples and the API reference, see the driver's [docs.rs page](https://docs.rs/mongodb/2.0.0-beta.2).
67
67
68
68
### Using the async API
69
69
#### Connecting to a MongoDB deployment
@@ -113,7 +113,7 @@ let docs = vec can be parameterized with any type that implements the `Serialize` and `Deserialize` traits from the [`serde`](https://serde.rs/) crate, not just `Document`:
116
+
A [`Collection`](https://docs.rs/mongodb/2.0.0-beta.2/mongodb/struct.Collection.html) can be parameterized with any type that implements the `Serialize` and `Deserialize` traits from the [`serde`](https://serde.rs/) crate, not just `Document`:
Results from queries are generally returned via [`Cursor`](https://docs.rs/mongodb/2.0.0-beta.1/mongodb/struct.Cursor.html), a struct which streams the results back from the server as requested. The [`Cursor`](https://docs.rs/mongodb/2.0.0-beta/mongodb/struct.Cursor.html) type implements the [`Stream`](https://docs.rs/futures/latest/futures/stream/index.html) trait from the [`futures`](https://crates.io/crates/futures) crate, and in order to access its streaming functionality you need to import at least one of the [`StreamExt`](https://docs.rs/futures/latest/futures/stream/trait.StreamExt.html) or [`TryStreamExt`](https://docs.rs/futures/latest/futures/stream/trait.TryStreamExt.html) traits.
153
+
Results from queries are generally returned via [`Cursor`](https://docs.rs/mongodb/2.0.0-beta.2/mongodb/struct.Cursor.html), a struct which streams the results back from the server as requested. The [`Cursor`](https://docs.rs/mongodb/2.0.0-beta.2/mongodb/struct.Cursor.html) type implements the [`Stream`](https://docs.rs/futures/latest/futures/stream/index.html) trait from the [`futures`](https://crates.io/crates/futures) crate, and in order to access its streaming functionality you need to import at least one of the [`StreamExt`](https://docs.rs/futures/latest/futures/stream/trait.StreamExt.html) or [`TryStreamExt`](https://docs.rs/futures/latest/futures/stream/trait.TryStreamExt.html) traits.
0 commit comments