Skip to content

Commit

Permalink
minor: update version and readme for release candidate (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
saghm authored Jun 3, 2020
1 parent f7f785f commit 7156e1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/mongodb/mongo-rust-driver"
license = "Apache-2.0"
readme = "README.md"
name = "mongodb"
version = "0.10.0"
version = "0.11.0"

[features]
default = ["tokio-runtime"]
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MongoDB Rust Driver
[![Crates.io](https://img.shields.io/crates/v/mongodb.svg)](https://crates.io/crates/mongodb) [![docs.rs](https://docs.rs/mongodb/badge.svg)](https://docs.rs/mongodb) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)

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 depends on the [`bson`](https://docs.rs/bson) 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.
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) 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.

## Index
- [Installation](#Installation)
Expand All @@ -26,16 +26,16 @@ This repository contains the officially supported MongoDB Rust driver, a client
| Driver Version | Required Rust Version |
|:--------------:|:---------------------:|
| master | 1.43+ |
| 0.11.x | 1.43+
| 0.10.x | 1.43+ |
| 0.9.x | 1.39+ |
- MongoDB 3.6+

### Importing
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`. You will also want to add [`bson`](https://docs.rs/bson) as well.
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`.
```toml
[dependencies]
mongodb = "0.10.0"
bson = "0.14.1"
mongodb = "0.11.0"
```

#### Configuring the async runtime
Expand All @@ -44,7 +44,7 @@ The driver supports both of the most popular async runtime crates, namely [`toki
For example, to instruct the driver to work with [`async-std`](https://crates.io/crates/async-std), add the following to your `Cargo.toml`:
```toml
[dependencies.mongodb]
version = "0.10.0"
version = "0.11.0"
default-features = false
features = ["async-std-runtime"]
```
Expand All @@ -53,7 +53,7 @@ features = ["async-std-runtime"]
The driver also provides a blocking sync API. To enable this, add the `"sync"` feature to your `Cargo.toml`:
```toml
[dependencies.mongodb]
version = "0.10.0"
version = "0.11.0"
default-features = false
features = ["sync"]
```
Expand Down Expand Up @@ -94,7 +94,7 @@ for collection_name in db.list_collection_names(None).await? {
```
#### Inserting documents into a collection
```rust
use bson::doc;
use mongodb::bson::doc;
```
```rust
// Get a handle to a collection in the database.
Expand All @@ -111,9 +111,11 @@ collection.insert_many(docs, None).await?;
```
#### Finding documents in a collection
```rust
use bson::{doc, Bson};
use futures::stream::StreamExt;
use mongodb::options::FindOptions;
use mongodb::{
bson::{doc, Bson},
options::FindOptions,
};
```
```rust
// Query the documents in the collection with a filter and an option.
Expand Down Expand Up @@ -141,8 +143,10 @@ The driver also provides a blocking sync API. See the [Installation](#enabling-t

The various sync-specific types are found in the `mongodb::sync` submodule rather than in the crate's top level like in the async API. The sync API calls through to the async API internally though, so it looks and behaves similarly to it.
```rust
use bson::{doc, Bson};
use mongodb::sync::Client;
use mongodb::{
bson::{doc, Bson},
sync::Client,
};
```
```rust
let client = Client::with_uri_str("mongodb://localhost:27017")?;
Expand Down

0 comments on commit 7156e1e

Please sign in to comment.