Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add ObjectID for test

  • Loading branch information...
commit 060d6fa1cb3b975faa6fe53232b8f6b5f3c4e146 1 parent 853d274
@zzdhidden authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  test/mongoq.js
3  test/mongoq.js
@@ -3,6 +3,7 @@ var db = require("mongoq");
//var testdb = db("testdb", {host: "localhost", port: "27017"});
var testdb = db("mongodb:\/\/localhost/testdb");
var col = testdb.collection("col");
+var BSON = db.mongodb.BSONNative;
//equal ok notEqual deepEqual
//['insert', 'remove', 'rename', 'insertAll', 'save', 'update', 'distinct', 'count', 'drop', 'findAndModify', 'find', 'findOne', 'createIndex', 'ensureIndex', 'indexInformation', 'dropIndex', 'dropIndexes', 'mapReduce', 'group']
col.insert({"init": true}, function(err, doc) {
@@ -11,7 +12,7 @@ col.insert({"init": true}, function(err, doc) {
col.drop(function(err) {
assert.strictEqual(err, null);
- var data = [{'name':'William Shakespeare', 'email':'', 'age':587},{'name':'Jorge Luis Borges', 'email':'', 'age': 587}];
+ var data = [{'_id': new BSON.ObjectID('4dd3a7d8a48efdcf19000001'), 'name':'William Shakespeare', 'email':'', 'age':587},{'_id': new BSON.ObjectID(), 'name':'Jorge Luis Borges', 'email':'', 'age': 587}];
col.insert(data, function(err, doc) {
col.findItems({}, function(err, doc){
assert.equal(doc.length, 2);
Please sign in to comment.
Something went wrong with that request. Please try again.