Introduce to Document-oriented Database: MongoBD.

Conception

  • Document -> Collection -> Database
  • Example: MongoDB (using in Web App)
    • using B-Tree as storage structure
  • Object Oriented Programming
    • Unifying programming model and data model
    • Everything is treated as object

Document

  • like json, the key-value pair
  • kv
  • Document can be seen as object

Collection

  • a class of document
  • can be seen as class

Database

  • some documents constitute a database
  • usually for one application

Interface

Insert

> db.foo.insert({"bar":"bsd})
> db.foo.batchInsert([{"_id":0},{"_id":1},{"_id":2}])

Find

find

Delete

> db.foo.remove()
> db.mailing.list.remove({"opt-out":true})

Update

update

Useful link

results matching ""

    No results matching ""