Created
October 24, 2010 13:56
-
-
Save dvv/643545 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
package.json contains | |
"mongodb": "jar:http://github.com/christkv/node-mongodb-native/zipball/master!/lib/mongodb/", | |
*/ | |
var Cursor, DB, DBServer, client, server; | |
DB = require('mongodb/db').Db; | |
DBServer = require('mongodb/connection').Server; | |
Cursor = require('mongodb/cursor').Cursor; | |
Cursor.prototype.formattedOrderClause = function() { | |
return this.sortValue; | |
}; | |
server = new DBServer('127.0.0.1', 27017, {}); | |
client = new DB('omega', server, {native_parser: true}); | |
client.open(function(err, db) { | |
console.log('MONGO CLIENT OK'); | |
return db.collection('Log', function(err, collection) { | |
console.log(new Date()); | |
return collection.find({}, { | |
limit: 1 | |
}, function(err, cursor) { | |
return cursor.toArray(function(err, items) { | |
console.log('ITEMS', items.length); | |
return console.log(new Date()); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment