SELECT movies.*
FROM oscar_winners
JOIN movies ON (oscar_winners.movie_id = movies.id)
JOIN directors ON (movies.director_id = directors.id)
WHERE directors.year_of_birth > 1985
import redis
pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
redis = redis.Redis(connection_pool=pool)
redis.get('title') //some value
redis.set(user_id, session_string)
SQL | MongoDB | |
database | = | database |
table | = | collection |
row | = | binary JSON document |
column | = | field |
index | = | index |
table joins | = | embedded documents and linking |
//inserting a document into the books collection
//with an embedded author document
//and an array of related works ids
db.books.insert({
"isdn": "2414993-2204",
"title": "To ask a foolish question",
"author": {
"name":"Robert Sheckley",
"occupation": "Sci-fi author"
},
"first_published_on": ISODate("1953-03-11"),
"related_works_ids": [MongoRef("77a2bc3"), MongoRef("32d3298")]
});
//querying the database
//for the book with the given isdn
db.books.find({ isdn: "2414993-2204" });
//for books with a specified genre
db.books.find({ genre: { $exists: 1 });
//for books published after the given date
db.books.find({
first_published_on: {$gt: ISODate("1987-03-11")}
});
//for books with an author name
//matching the the regular expression
db.books.find({ "author.name": /Sheckley/ });
public String GetClicks(String action, String date, byte[] column)
throws IOException {
try (Connection conn = ConnectionFactory.createConnection(config)) {
Table table = conn.getTable(TableName.valueOf(TABLE_NAME));
Get get = new Get(makeKey(date, symbol));
get.addColumn(COLUMN_FAMILY, column);
Result r = table.get(get);
if ( r.isEmpty() ) return null;
return new String(r.value());
}
}
MATCH (p1:Person {id: "me"})-[r:Follows]-(p2:Person {interest: "juggling"})
RETURN p1.name, r, p2.name; //Misho Follows Wes Peden
week 1 03.02.2017 | History of the web | Fullstack Principles | Development Processes | Agile Processes | DevOps Basics | Git |
week 2 10.02.2017 | Frontend Overview | Backend Overview | Network Overview | Testing | JavaScript Overview | JavaScript Tooling |
week 3 17.02.2017 | Web Architectures | RESTful principles | SOLID principles | Web Components | Continuous Integration | |
week 4 24.02.2017 | Databases basics | Using APIs | Deployment Automation | Monitoring | In-class project consultations | |
week 5 17.03.2017 |
Project presentations Final Test Course Retrospective and Q&A |