mysql5.7提供了json字段的查询支持,不知道nutz是否也支持这种类型的建表和查询?
CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
INSERT INTO user VALUES(1 ,"lucy",'{"time":"2015-01-01 13:00:00","ip":"192.168.1.1","result":"fail"}');
INSERT INTO user VALUES(2 ,"bobo",'{"time":"2015-10-07 06:44:00","ip":"192.168.1.0","result":"success"}');
INSERT INTO user VALUES(3 ,"lucy2",JSON_OBJECT("time",NOW(),"ip","192.168.1.1","result","fail"));
ELECT * FROM user WHERE lastlogininfo ->'$.time' > '2015-10-02';