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.3) 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/latest) 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)
@@ -36,7 +36,7 @@ This repository contains the officially supported MongoDB Rust driver, a client
36
36
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`.
37
37
```toml
38
38
[dependencies]
39
-
mongodb = "2.0.0-beta.3"
39
+
mongodb = "2.0.0"
40
40
```
41
41
42
42
#### Configuring the async runtime
@@ -45,7 +45,7 @@ The driver supports both of the most popular async runtime crates, namely [`toki
45
45
For example, to instruct the driver to work with [`async-std`](https://crates.io/crates/async-std), add the following to your `Cargo.toml`:
46
46
```toml
47
47
[dependencies.mongodb]
48
-
version = "2.0.0-beta.3"
48
+
version = "2.0.0"
49
49
default-features = false
50
50
features = ["async-std-runtime"]
51
51
```
@@ -54,7 +54,7 @@ features = ["async-std-runtime"]
54
54
The driver also provides a blocking sync API. To enable this, add the `"sync"` feature to your `Cargo.toml`:
55
55
```toml
56
56
[dependencies.mongodb]
57
-
version = "2.0.0-beta.3"
57
+
version = "2.0.0"
58
58
default-features = false
59
59
features = ["sync"]
60
60
```
@@ -68,11 +68,11 @@ features = ["sync"]
68
68
|`async-std-runtime`| Enable support for the `async-std` runtime |`async-std` 1.0 | no |
69
69
|`sync`| Expose the synchronous API (`mongodb::sync`). This flag cannot be used in conjunction with either of the async runtime feature flags. |`async-std` 1.0 | no |
70
70
|`aws-auth`| Enable support for the MONGODB-AWS authentication mechanism. |`reqwest` 0.11 | no |
71
-
|`bson-uuid-0_8`| Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. |`uuid` 0.8| no |
71
+
|`bson-uuid-0_8`| Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. |n/a | no |
72
72
|`bson-chrono-0_4`| Enable support for v0.4 of the [`chrono`](docs.rs/chrono/0.4) crate in the public API of the re-exported `bson` crate. | n/a | no |
73
73
74
74
## Example Usage
75
-
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.3).
75
+
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/latest).
76
76
77
77
### Using the async API
78
78
#### Connecting to a MongoDB deployment
@@ -122,7 +122,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`:
125
+
A [`Collection`](https://docs.rs/mongodb/latest/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.3/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.3/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.
162
+
Results from queries are generally returned via [`Cursor`](https://docs.rs/mongodb/latest/mongodb/struct.Cursor.html), a struct which streams the results back from the server as requested. The [`Cursor`](https://docs.rs/mongodb/latest/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.
Copy file name to clipboardExpand all lines: src/lib.rs
+5-5
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
//! your application, simply add it to your project's `Cargo.toml`.
17
17
//! ```toml
18
18
//! [dependencies]
19
-
//! mongodb = "2.0.0-beta.3"
19
+
//! mongodb = "2.0.0"
20
20
//! ```
21
21
//!
22
22
//! ### Configuring the async runtime
@@ -30,7 +30,7 @@
30
30
//! add the following to your `Cargo.toml`:
31
31
//! ```toml
32
32
//! [dependencies.mongodb]
33
-
//! version = "2.0.0-beta.3"
33
+
//! version = "2.0.0"
34
34
//! default-features = false
35
35
//! features = ["async-std-runtime"]
36
36
//! ```
@@ -40,7 +40,7 @@
40
40
//! `Cargo.toml`:
41
41
//! ```toml
42
42
//! [dependencies.mongodb]
43
-
//! version = "2.0.0-beta.3"
43
+
//! version = "2.0.0"
44
44
//! default-features = false
45
45
//! features = ["sync"]
46
46
//! ```
@@ -56,7 +56,7 @@
56
56
//! | `async-std-runtime` | Enable support for the `async-std` runtime | `async-std` 1.0 | no |
57
57
//! | `sync` | Expose the synchronous API (`mongodb::sync`). This flag cannot be used in conjunction with either of the async runtime feature flags. | `async-std` 1.0 | no |
58
58
//! | `aws-auth` | Enable support for the MONGODB-AWS authentication mechanism. | `reqwest` 0.11 | no |
59
-
//! | `bson-uuid-0_8` | Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. | `uuid` 0.8 | no |
59
+
//! | `bson-uuid-0_8` | Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. | n/a | no |
60
60
//! | `bson-chrono-0_4` | Enable support for v0.4 of the [`chrono`](docs.rs/chrono/0.4) crate in the public API of the re-exported `bson` crate. | n/a | no |
0 commit comments