MongoDB与MySQL对比

1.数据结构
MySQL 表 > 行 tables > rows
MongoDB 表 > 行 collections > documents
2.启动
MySQL mysql -u root -p
MongoDB mongo
3.操作
3.1.查看库
MySQL show databases
MongoDB show dbs
3.2.使用库
MySQL use test
MongoDB use test
3.3.查看表
MySQL show tables
MongoDB show collections
3.4.查询
MySQL SELECT * FROM test WHERE name = ‘john’;
MongoDB db.test.find({‘name’: ‘john’})

MongoDB的语法是js语法,比较适合前端人学习
参考文章:
数据库 MongoDB 与 MySQL 深入对比

此条目发表在数据库分类目录。将固定链接加入收藏夹。

发表评论

邮箱地址不会被公开。 必填项已用*标注