【SequoiaDB|巨杉数据库】SDB Shell 基本操作
连接 SequoiaDB 实例:
db = new Sdb(“localhost”,11810)
创建数据域:
db.createDomain(“domain_1”,[“group1”,“group2”,“group3”],{AutoSplit:true})
创建集合空间:
db.createCS(“employees”,{Domain:“domain_1”})
创建集合:
db.employees.createCL(“employees”,{ShardingKey:{“id”:1},ShardingType:“hash”,Compressed:true,CompressionType:“lzw”,AutoSplit:true,EnsureShardingIndex:false})
创建唯一索引:
db.employees.employees.createIndex(“id_PriIdx”,{“id”:1},true)
插入两条记录:
db.employees.employees.insert({“id”:1,“name”:“xiaoli”,“phone”:5553})
db.employees.employees.insert({“id”:2,“name”:“xiaozhang”,“phone”:1371})
按条件修改一条记录: