sequoiadb学习笔记
数值类型 | 定义 | 比较优先级权值 | 用例 |
整数
|
整数,范围 -2147483648 至 2147483647 |
|
10 |
|
{ "key" : 123 }
|
长整数
|
整数,范围 -9223372036854775808 至 9223372036854775807 如果用户指定的数值无法适用于整数,则 SequoiaDB 自动将 其转化为浮点型
|
10
|
{ "key" : 3000000000 }
|
浮点数
|
浮点数,范围 -1.7E+308 至 1.7E+308
|
10
|
{ "key" : 123.456 } 或 { "key" : 123e+50 }
|
字符串
|
双引号包含的字符串
|
15
|
{ "key" : "value" }
|
对象 ID(OID)
|
十二字节对象 ID
|
35
|
{ "key" : { "$oid" : "123abcd00ef12358902300ef" } }
|
布尔
|
true 或者 false
|
40
|
{ "key" : true } 或 { "key" : false }
|
日期
|
YYYY-MM-DD 的日期形式 范围 1900-01-01 至 9999-12-31
|
45
|
{ "key" : { "$date" : "2012-01-01" } }
|
时间戳
|
YYYY-MM-DD-HH.mm.ss.ffffff 的形式存取 范围 1902-01-01 00:00:00.000000 至 2037-12-31 23:59:59.999999
|
45
|
{ "key" : { "$timestamp" : "2012-01-01-13.14.26.124233" } }
|
二进制数据
|
Base64 形式的二进制数据
|
30
|
{ "key" : { "$binary" : "aGVsbG8gd29ybGQ=", "$type" : "1" } }
|
正则表达式
|
正则表达式
|
50
|
{ "key" : { "$regex" : "^张", "$options" : "i" } }
|
对象
|
嵌套 JSON 文档对象
|
20
|
{ "key" : { "subobj" : "value" } }
|
数组
|
嵌套数组对象
|
25
|
{ "key" : [ "abc", 0, "def" ] }
|
空
|
null
|
5
|
{ "key" : null }
|
SequoiaDB | 数据库实例 | 代表一个单独的数据库连接 |
CollectionSpace | 集合空间实例 | 代表一个单独的集合空间 |
DBCollection | 集合实例 | 代表一个单独的集合 |
DBCursor | 游标实例 | 代表一个查询产生的结果集 |
DBLob | 大对象实例 | 代表一个大对象 |
SQL | SequoiaDB shell | Java Driver |
insert into students(a,b) values(1,-1)
|
db.foo.bar.insert({a:1,b:-1})
|
bar.insert("{'a':1,'b':-1}")
|
select a,b from students
|
db.foo.bar.find(null,{a:"",b:""})
|
bar.query("", "{'a':'','b':''}", "", "")
|
select * from students
|
db.foo.bar.find()
|
bar.query()
|
select * from students where age=20
|
db.foo.bar.find({age:20})
|
bar.query("{'age':20}", "", "", "")
|
select * from students where age=20 order by name
|
db.foo.bar.find({age:20}).sort({name:1})
|
bar.query("{'age':20}", "", "{'name':1}", "")
|
select * from students where age > 20 and age < 30
|
db.foo.bar.find({age:{$gt:20,$lt:30}})
|
bar.query("{'age':{'$gt':20,'$lt':30}}", "", "", "")
|
create index testIndex on students(name)
|
db.foo.bar.createIndex("testIndex",{name:1},false)
|
bar.createIndex("testIndex", "{'name':1}", false, false)
|
select * from students limit 20 skip 10
|
db.foo.bar.find().limit(20).skip(10)
|
bar.query("", "", "", "", 10, 20)
|
select count(*) from students where age > 20
|
db.foo.bar.find({age:{$gt:20}}).count()
|
bar.getCount("{'age':{'$gt':20}}")
|
update students set a=a+2 where b=-1
|
db.foo.bar.update({$set:{a:2}},{b:-1})
|
bar.update("{'b':-1}", "{'$inc':{'a':2}}", "")
|
delete from students where a=1
|
db.foo.bar.remove({a:1})
|
bar.delete("{'a':1}")
|
Create 和 Alter
SQL 语句 | SequoiaDB 语句 |
create table student (id not null, stu_id varchar(50), age number primary key(id)) |
db.collectionspace.student({stu_id:"01",age:20})
db.collectionspace.createCL("student")
|
alter table student add name varchar(50) | db.collectionspace.student.update({},{$set:{name:"Tom"}}) |
alter table student drop column name | db.collectionspace.student.update({},{$unset:{name:"Tom"}}) |
create index index_stu_id on student (stu_id) | db.collectionspace.student.createIndex("index_stu_id",{stu_id:-1}) |
drop table student | db.collectionspace.dropCL("student") |
Insert
SQL 语句 | SequoiaDB 语句 |
insert into student(stu_id,age) values("01",20)
|
db.collectionspace.student.insert({stu_id:"01",age:20})
|
Select
SQL 语句 | SequoiaDB 语句 |
select * from student
|
db.collectionspace.student.find()
|
select stu_id, age from student
|
db.collectionspace.student.find({},{stu_id:"01",age:20})
|
select * from student where age > 25
|
db.collectionspace.student.find({age:{$gt:25}})
|
select age from student where age = 25 and stu_id= "01"
|
db.collectionspace.student.find({age:25,stu_id="01"},{age:25})
|
select count(*) from student
|
db.collectionspace.student.count()
|
select count(stu_id) from student
|
db.collectionspace.student.count({stu_id:{$exists:1}})
|
Update
SQL 语句 | SequoiaDB 语句 |
update student set age = 25 where stu_id = "01" | db.collectionspace.student.update({stu_id:"01"},{$set:{age:25}}) |
update student set age = age + 2 where stu_id = "01" | db.collectionspace.student.update({stu_id:"01"},{$inc:{age:2}}) |
Delete
SQL 语句 | SequoiaDB 语句 |
delete from student where age = 20 | db.collectionspace.student.remove({age:20}) |
delete from student | db.collectionspace.student.remove() |
sequoiadb学习笔记相关推荐
- 巨杉数据库 sequoiadb学习笔记
1. sequoiaDB 5.0 支持安全鉴权协议是:SCRAM-SHA-256 和 MD5 2. sequoiaDB 逻辑时间包含:本地,全局,逻辑时间容错差 3种 3. sequoi ...
- SequoiaDB v5.2 学习笔记
SequoiaDB v5.2 学习笔记 文章目录 SequoiaDB v5.2 学习笔记 湖仓一体 什么是"湖仓一体"? 为什么要引入湖仓一体? 市场需求 "数据沼泽&q ...
- NoSQL学习笔记之MongoDB-01初识NoSQL
NoSQL学习笔记之MongoDB-01初识NoSQL 一.什么是NoSQL NoSQL的出现背景: 随着互联网的发展,数据量激增,传统的集中式关系型数据库已经无法满足互联网海量数据的存储及使用需求. ...
- 巨杉数据库学习笔记+巨杉数据库实操项目实践
@TOC巨杉数据库学习笔记+项目实践心得 SequoialDB简介 SequoiaDB 巨杉数据库是一款金融级分布式数据库,主要面对高并发实时处理型场景提供高性能.可靠稳定以及无限水平扩展的数据库服务 ...
- PyTorch 学习笔记(六):PyTorch hook 和关于 PyTorch backward 过程的理解 call
您的位置 首页 PyTorch 学习笔记系列 PyTorch 学习笔记(六):PyTorch hook 和关于 PyTorch backward 过程的理解 发布: 2017年8月4日 7,195阅读 ...
- 容器云原生DevOps学习笔记——第三期:从零搭建CI/CD系统标准化交付流程
暑期实习期间,所在的技术中台-效能研发团队规划设计并结合公司开源协同实现符合DevOps理念的研发工具平台,实现研发过程自动化.标准化: 实习期间对DevOps的理解一直懵懵懂懂,最近观看了阿里专家带 ...
- 容器云原生DevOps学习笔记——第二期:如何快速高质量的应用容器化迁移
暑期实习期间,所在的技术中台-效能研发团队规划设计并结合公司开源协同实现符合DevOps理念的研发工具平台,实现研发过程自动化.标准化: 实习期间对DevOps的理解一直懵懵懂懂,最近观看了阿里专家带 ...
- 2020年Yann Lecun深度学习笔记(下)
2020年Yann Lecun深度学习笔记(下)
- 2020年Yann Lecun深度学习笔记(上)
2020年Yann Lecun深度学习笔记(上)
最新文章
- hadoop配置文件默认配置
- 利用canvas绘制动态仪表盘
- django缓存优化(二)
- 计算机爱好者协会义务维修的目的,计算机协会义务维修活动总结范文
- [洛谷P4838]P哥破解密码
- Isight做MATLAB优化,iSight结构优化基础16讲-学会使用isight控制ABAQUS、APDL等CAE软件...
- 常见数据结构面试题(2022年最新版)
- 对多元函数微分一些思考和总结
- librosa的短时傅里叶实现librosa.stft()
- 什么叫DMZ区?DMZ区它有什么作用?
- 幼儿-综合素质【9】
- 条件覆盖,路径覆盖,语句覆盖
- 蜘蛛:请求头、响应头、响应码
- leetcode_Permutations II
- pion demo运行
- 你真的了解“药品追溯码”吗?
- 蓝牙HC-05出现进入AT模式之后串口发送AT无返回值或者返回乱码情况
- 无法加载操作系统,原因是关键系统驱动驱动程序丢失或包含错误 kisboot.sys
- mysql compact_在 MySQL InnoDB 中,COMPRESSED, COMPACT 和DYNAMIC 有什么区别?
- 与2,3,5无关的数
热门文章
- 0CTF-2016-piapiapia(php反序列化长度变化尾部字符串逃逸)
- 物联网毕设 -- 基于STM32的水产养殖
- 24.(C语言)根据输入的三角形的三边判断是否能组成三角形,若可以则输出它的面积
- CVE-2016-0165 分析利用POC
- 《谁动了我的奶酪》阅读笔记
- Webservice应用
- 多串口卡在装车计量系统中的应用 (转)
- 陕西铨讯电子厂工程师_2020年陕西省工业和信息化厅关于工程师职称评审的公告...
- 借助台式机和笔记本完成vsphere5.1的实验
- 使用css样式替换pre标签