Skip to content

Commit c882312

Browse files
author
Visnu Pitiyanuvath
committed
Braid: Update mirror 'lib/node-mongodb-native' to 'cb074b6'
1 parent d3f289c commit c882312

Some content is hidden

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

57 files changed

+6505
-2033
lines changed

.braids

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ lib/hoptoad-notifier:
7979
lib/node-mongodb-native:
8080
branch: master
8181
remote: braid/lib/node-mongodb-native
82-
revision: f7671cd0b5b3a849fc542723e9817a9fa2c1b31a
82+
revision: cb074b6f14285f9b1b5dccc41e59b41205b3f6b4
8383
squashed: true
8484
type: git
8585
url: http://github.com/christkv/node-mongodb-native.git

lib/node-mongodb-native/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.DS_Store
1+
.DS_Store
2+
*.swp
3+
*.seed

lib/node-mongodb-native/HISTORY

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
0.6.8
2+
* Removed multiple message concept from bson
3+
* Changed db.open(db) to be db.open(err, db)
14
0.1 2010-01-30
25
* Initial release support of driver using native node.js interface
3-
* Supports gridfs specification
6+
* Supports gridfs specificatio
47
* Supports admin functionality

lib/node-mongodb-native/Makefile

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22
NODE = node
33
name = all
44

5+
total: build_native test_all
6+
7+
build_native:
8+
$(MAKE) -C ./external-libs/bson
9+
510
test:
611
@$(NODE) spec/spec.node.js
712

8-
test_all: test integrate_test
13+
test_all: test integrate_test_all
914

1015
integrate_test:
11-
@$(NODE) integration/integration_tests.js $(name)
16+
@$(NODE) integration/integration_tests.js pure $(name)
17+
18+
integrate_test_all:
19+
@$(NODE) integration/integration_tests.js pure $(name)
20+
@$(NODE) integration/integration_tests.js native $(name)
1221

13-
.PHONY: test
22+
.PHONY: total

lib/node-mongodb-native/benchmark/streaming_benchmark.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
require.paths.unshift('../lib');
2+
require.paths.unshift('../external-libs/bson');
23

34
var Db = require('mongodb').Db,
45
Server = require('mongodb').Server,
5-
ObjectID = require('mongodb').ObjectID,
66
Cursor = require('mongodb').Cursor,
77
Collection = require('mongodb').Collection,
8-
sys = require('sys');
8+
sys = require('sys');
9+
var BSON = require('bson');
910

10-
new Db('streaming_benchmark', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {}).open(function(err, client) {
11+
var db = new Db('streaming_benchmark', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {})
12+
// Set native deserializer
13+
db.bson_deserializer = BSON;
14+
db.bson_serializer = BSON;
15+
db.pkFactory = BSON.ObjectID;
16+
17+
// Open the db
18+
db.open(function(err, client) {
1119
client.collection('streaming_benchmark', function(err, collection) {
1220
collection.remove({}, function(err, result) {
1321
// Benchmark
1422
var started_at = new Date().getTime();
1523
// Add documents
1624
for(var i = 0; i < 100000; i++) {
25+
// for(var i = 0; i < 1000; i++) {
1726
collection.save({'i':i, 'a':i, 'c':i, 'd':{'i':i}}, function(err, result){});
1827
}
1928
sys.puts("save recs: " + ((new Date().getTime() - started_at)/1000) + "seconds");
@@ -32,7 +41,7 @@ new Db('streaming_benchmark', new Server("127.0.0.1", 27017, {auto_reconnect: tr
3241
if ((count%10000)==0) sys.puts("recs:" + count + " :: " +
3342
((new Date().getTime() - started_at)/1000) + "seconds");
3443
});
35-
});
44+
});
3645
})
3746
})
3847
});

lib/node-mongodb-native/examples/admin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/blog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/capped.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/cursor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/gridfs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/index_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb'),
77
Integer = require('../lib/mongodb/goog/math/integer').Integer;

lib/node-mongodb-native/examples/info.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/queries.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/simple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/strict.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

lib/node-mongodb-native/examples/types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GLOBAL.DEBUG = true;
22

33
sys = require("sys");
4-
test = require("mjsunit");
4+
test = require("assert");
55

66
var mongo = require('../lib/mongodb');
77

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
GLOBAL.DEBUG = true;
2+
3+
sys = require("sys");
4+
test = require("assert");
5+
6+
var mongo = require('../lib/mongodb');
7+
8+
sys.puts('Connecting to ' + (process.env.MONGO_URL || mongo.Db.DEFAULT_URL));
9+
mongo.connect(process.env.MONGO_URL, function(err, db) {
10+
db.dropDatabase(function(err, result) {
11+
db.collection('test', function(err, collection) {
12+
collection.insert({'a':1});
13+
db.close();
14+
});
15+
});
16+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
bson.node
3+
.lock-wscript
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
NODE = node
3+
name = all
4+
5+
all:
6+
rm -rf build .lock-wscript bson.node
7+
node-waf configure build
8+
@$(NODE) test_bson.js
9+
@$(NODE) test_full_bson.js
10+
11+
test:
12+
@$(NODE) test_bson.js
13+
@$(NODE) test_full_bson.js
14+
15+
.PHONY: all

0 commit comments

Comments
 (0)