SQL MongoDB

MongoDB

  • What is MongoDB?
    It is a kind of NoSQL, no relation between tables.
    Java Script is for MongoDB’s query.

  • Terminology on NoSQL

  1. tables = collections
  2. documents = records
  3. create databases = use [database name]
  4. query in MySQL = begin with Select but query in NoSQL = db.[collection name].find()
  5. if there are some conditions about data, add the conditions in ().
  6. operator begins with $.
  • comparative operator:
  1. $lt = < (less than), $lte = <= (less than and equal)
  2. $gt = > (greater than), $gte = >= (greater than and equal)
  3. $eq = = (is equal)
  • logical operator: $or, $and, $not, $nor
  1. function: begin with
    var [variance name] = function(~){
    formula
    return ~
    }
  2. making an order = sort: 1 = asc, -1 = desc, .sort({column name: 1 or -1})
  3. skip(#).limit(#) = limit #, # in MySQL
  • please check the extra examples and the formula in depth on my Naver blog and Github blog!