2015年1月21日星期三

MongoDB week1 Notes

MongoDB is a non-relational data store for JSON documents.
JSON document is like: { key : field }. And it could have some hierarchical. 
MongoDB is also schemaless.
MongoDB tries to maintain scalability and  performance as well as provide much functionality. 
  • MongoDB does not support joins
  • MongoDB also does not support transactions
MongoDB continuos to listen for connections and expect BSON data, there is some protocol to explain this kind of data. A mongoDB driver is a library in some specific language to communicate with mongoDB.

app.get(url, function (req, res) {}) —> tell the express how to response to url with get method.
app.get(‘*’, function (req, res) {}) —> ‘*’ is a wildcard matching and anything not handled above would be handled here.
var cons = require(‘consolidate’)
app.engine(‘html’, cons.swig) —> set the template engine for express.
app.set(‘view engine’, ‘html’)
app.set(‘views’, __dirname + ‘/views’)


There are typically two kinds of things in JSON, arrays [   ] and dictionaries {  }, which is associative maps.

没有评论:

发表评论