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

Commit 90fab0f

Browse files
committed
Merge pull request #131 from saghm/mongo-3.2
Updated for Mongo 3.2
2 parents 01fe6c6 + 4ccd8bb commit 90fab0f

Some content is hidden

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

63 files changed

+3333
-17
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.

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.
File renamed without changes.

0 commit comments

Comments
 (0)