SequoiaDB 简介						 
					
						快速入门						 
					
						安装部署						 
					
						数据库实例						 
					
						分布式引擎						 
					
						SAC 管控中心						 
					
						SequoiaPerf 性能分析工具						 
					
						参考手册						 
					
						常见问题及解答(FAQ)						 
					
						版本信息						 
					
update 用于修改集合中的记录。
update <cs_name>.<cl_name> set (<field1_name>=<value1>,...) [where <condition>] [/*+<hint1> <hint2> ...*/]
| 参数名 | 参数类型 | 描述 | 是否必填 | 
|---|---|---|---|
| cs_name | string | 集合空间名 | 是 | 
| cl_name | string | 集合空间名 | 是 | 
| field1_name | string | 字段名 | 是 | 
| value1 | string | 字段值 | 是 | 
| condition | expression | 条件,只对符合条件的记录更新 | 是 | 
| hint1 | hint | 指定执行方式 | 是 | 
无
集合 sample.employee 中原始记录如下:
{ age: 1 }
{ age: 2 }修改集合中全部的记录,将记录中的 age 字段值修改为20
> db.execUpdate( "update sample.employee set age=20" )
修改符合条件的记录,只对符合条件 age < 25 的记录做修改操作
> db.execUpdate( "update sample.employee set age=30 where age < 25" )
指定更新时保留分区键,切分表 sample.employee 落在两个复制组上,分区键为 { b: 1 }
> db.execUpdate( "update sample.employee set b = 1 where age < 25 /*+use_flag(SQL_UPDATE_KEEP_SHARDINGKEY)*/" ) (nofile):0 uncaught exception: -178 Sharding key cannot be updated
 展开
            展开
          
   
   
   
   
   
   
   
