Added remote folder

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-29 13:30:54 +01:00
parent 97e7dfd7c4
commit 95bb0c3919
3521 changed files with 331825 additions and 0 deletions

32
server/node_modules/mongodb/load.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
var MongoClient = require('./').MongoClient;
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
var col = db.collection('test');
col.ensureIndex({dt:-1}, function() {
var docs = [];
for(var i = 0; i < 100; i++) {
docs.push({a:i, dt:i, ot:i});
}
console.log("------------------------------- 0")
col.insertMany(docs, function() {
// Start firing finds
for(var i = 0; i < 100; i++) {
setInterval(function() {
col.find({}, {_id: 0, ot:0}).limit(2).sort({dt:-1}).toArray(function(err) {
console.log("-------------------------------- 1")
});
}, 10)
}
// while(true) {
//
// // console.log("------------------------------- 1")
// col.find({}, {_id: 0, ot:0}).limit(2).sort({dt:-1}).toArray(function(err) {
// console.log("-------------------------------- 1")
// });
// }
});
});
});