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