一.索引 CREATE INDEX 索引名 ON 表名(字段1, 字段2,……字段n) CREATE INDEX idx_person_nameage ON T_Person(FName,FAge) DROP INDEX 索引名ON 表名 DROP INDEX idx_person_nameage ON T_Person; 二.约束 数据库系统中主要提供了如下几种约束: 非空约束:唯一约束: CHECK 约束:主键约束:外键约束 1.非空约束 CREATE TABLE T_Person (FNu
用$where可以执行任意的js作为查询的一部分. db.foo.find({"$where" : function(){ for(var current in this){ for(var other in this){ if(current != other && this[current] == this[other]){ return true;