2012-09-17 - wdc12: node.js & mongodb
DESCRIPTION
Zwei neue Technologien für die Cloud sind das JavaScript-Framework Node.js und die NoSQL-Datenbank MongoDB. Johannes Hoppe gibt einen Schnellstart in die beiden Open-Source-Systeme.TRANSCRIPT
Anno 2006
Live Demosolartournament.org
var result = db.query("select * from table"); doSomething(result); // wait! doSomethingWithOutResult(); // blocked
db.query("select * from table", callback); doSomethingWithOutResult();
db.query("select * from table", function(result){ doSomething(result); //wait! }); doSomethingWithOutResult();
var http = require('http'); http.createServer(callback).listen();
var http = require('http'); var callback = function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); }; http.createServer(callback).listen();
http://bsonspec.org
{ _id : ObjectId("5055e94ae0745519e458ac70"), Title : "MongoDB Testeintrag", Message : "Ein gruener Postit", Added : ISODate("2012-05-12T22:00:00Z"), Categories : [ { Name : "Normal Importance", Color : "green" }, { Name : "Private", Color : "gray" }] }
››