Comparing version 0.3.1 to 0.3.2
module.exports = function (opts) { | ||
opts = opts || {}; | ||
var db = require('./tdb.js'); | ||
var ObjectID = opts.nativeObjectID ? require("mongodb").ObjectID : require("./ObjectId"); | ||
var ObjectID = opts.nativeObjectID ? (require("bson").ObjectID || require("mongodb").ObjectID) : require("./ObjectId"); | ||
if (opts.nativeObjectID) { | ||
@@ -15,3 +15,3 @@ ObjectID.prototype.valueOf = function () { | ||
this.Binary = require('./tbinary.js').Binary; | ||
this.Finder = require("./finder")(this); | ||
this.Finder = require("./finder")(this); | ||
} | ||
@@ -22,3 +22,3 @@ var F = function() { } | ||
gdb.prototype.constructor = gdb | ||
gdb.superclass = db.prototype | ||
gdb.superclass = db.prototype | ||
return { | ||
@@ -25,0 +25,0 @@ Db:gdb, |
{ | ||
"author": "PushOk Software <support@pushok.com>", | ||
"name": "tingodb", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"repository": { | ||
@@ -43,2 +43,5 @@ "type": "git", | ||
}, | ||
"optionalDependencies":{ | ||
"bson":"0.2.x" | ||
}, | ||
"devDependencies": { | ||
@@ -45,0 +48,0 @@ "csv": "0.3.x", |
@@ -40,3 +40,3 @@ TingoDB | ||
var db = new Db('test', new Server('locahost', 27017)); | ||
var db = new Db('test', new Server('localhost', 27017)); | ||
var collection = db.collection("batch_document_insert_collection_safe"); | ||
@@ -43,0 +43,0 @@ collection.insert([{hello:'world_safe1'} |
120600
4