diff --git a/Cargo.toml b/Cargo.toml index 34b9c76a8..d327c267c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/README.md b/README.md index a37e06ce0..d7800a5f4 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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"] ``` @@ -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"] ``` @@ -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. @@ -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. @@ -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")?;