Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit f1edf6f

Browse files
committed
Merge branch '1.0' of github.com:mongodbinc-interns/mongo-rust-driver-prototype into 1.0
2 parents 39a65a6 + 90fab0f commit f1edf6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3337
-19
lines changed

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
language: rust
22

33
before_install:
4-
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.3.tgz
5-
- tar xvf mongodb-linux-x86_64-3.0.3.tgz
6-
- mv mongodb-linux-x86_64-3.0.3 3.0.3
4+
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.7.tgz
5+
- tar xvf mongodb-linux-x86_64-3.0.7.tgz
6+
- mv mongodb-linux-x86_64-3.0.7 3.0.7
7+
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.0.tgz
8+
- tar xvf mongodb-linux-x86_64-3.2.0.tgz
9+
- mv mongodb-linux-x86_64-3.2.0 3.2.0
710

811
env:
912
- RUST_TEST_THREADS=1
1013

1114
script:
12-
- mkdir -p ./data/db ./data/test
13-
- 3.0.3/bin/mongod --fork --nopreallocj --dbpath ./data/db --syslog --port 27017
14-
- 3.0.3/bin/mongod --fork --nopreallocj --dbpath ./data/test --syslog --port 27018
15+
- mkdir -p ./data/db ./data/test ./data/db2 ./data/test2
16+
- 3.0.7/bin/mongod --fork --nopreallocj --dbpath ./data/db --syslog --port 27017
17+
- 3.0.7/bin/mongod --fork --nopreallocj --dbpath ./data/test --syslog --port 27018
1518
- cargo build --verbose
16-
- cargo test --verbose
19+
- cargo test v3_0 --verbose
20+
- killall mongod
21+
- 3.2.0/bin/mongod --fork --nopreallocj --dbpath ./data/db2 --syslog --port 27017
22+
- 3.2.0/bin/mongod --fork --nopreallocj --dbpath ./data/test2 --syslog --port 27018
23+
- cargo test v3_2 --verbose

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
MongoDB Rust Driver Prototype
44
=============================
55

6-
This branch contains active development on a new driver written for Rust 1.x.
6+
This branch contains active development on a new driver written for Rust 1.x and MongoDB 3.0.x.
77

8-
The API and implementation are currently subject to change at any time. You must not use this driver in production as it is still under development and is in no way supported by MongoDB Inc. We absolutely encourage you to experiment with it and provide us feedback on the API, design, and implementation. Bug reports and suggestions for improvements are welcomed, as are pull requests.
8+
The API and implementation are currently subject to change at any time. You should not use this driver in production as it is still under development and is in no way supported by MongoDB Inc. We absolutely encourage you to experiment with it and provide us feedback on the API, design, and implementation. Bug reports and suggestions for improvements are welcomed, as are pull requests.
9+
10+
**Note**: This driver currently only supports MongoDB 3.0.x. This driver is **not** expected to work with MongoDB 2.6 or MongoDB 3.2. Do not use this driver if you need support for other versions of MongoDB.
911

1012
Installation
1113
------------

src/cursor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ impl Cursor {
121121
if let Some(&Bson::I32(ref code)) = docs[0].get("code") {
122122
// If command doesn't exist or namespace not found, return
123123
// an empty array instead of throwing an error.
124-
if *code == ErrorCode::CommandNotFound as i32 ||
125-
*code == ErrorCode::NamespaceNotFound as i32 {
126-
return Ok((docs[0].clone(), v, cid));
127-
} else if let Some(&Bson::String(ref msg)) = docs[0].get("errmsg") {
124+
if *code != ErrorCode::CommandNotFound as i32 &&
125+
*code != ErrorCode::NamespaceNotFound as i32 {
126+
if let Some(&Bson::String(ref msg)) = docs[0].get("errmsg") {
128127
return Err(Error::OperationError(msg.to_owned()));
129128
}
129+
}
130130
}
131131
}
132132

tests/client/db.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ fn create_collection() {
1919
.expect("Failed to execute list_collections command.");;
2020

2121
let results = cursor.next_n(5).unwrap();
22+
2223
assert_eq!(3, results.len());
2324

2425
match results[0].get("name") {

tests/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ extern crate rand;
55
extern crate rustc_serialize;
66
extern crate nalgebra;
77

8-
mod apm;
9-
mod auth;
10-
mod client;
118
mod json;
12-
mod sdam;
13-
mod server_selection;
9+
mod v3_0;
10+
mod v3_2;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)