Browse Source

testExecuteSelectWithCompare方法描述修改

miaozy 4 years ago
parent
commit
8f0510b9c8

+ 3 - 3
ipu-mongodb-example/src/test/java/com/ai/ipu/example/mongodb/MongodbExampleWithSql.java

100
  /**
100
  /**
101
   * 使用标准SQL查询mongodb
101
   * 使用标准SQL查询mongodb
102
   * 比较符: >,>=,=,<=,<,!=
102
   * 比较符: >,>=,=,<=,<,!=
103
   * @desc 当前age列插入的是数值型,如果是字符型,以大于条件为例:where age > '20';
104
   * @throws Exception
103
   * @throws Exception
105
   */
104
   */
106
  public void testExecuteSelectWithCompare() throws Exception {
105
  public void testExecuteSelectWithCompare() throws Exception {
107
    log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age > 20"));
108
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age = 20"));
106
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age > 20"));
109
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age < 20"));
107
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age < 20"));
110
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age >= 20"));
108
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age >= 20"));
111
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age <= 20"));
109
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age <= 20"));
110
    //如果collection中的age列插入的数据类型如果是字符型,则等于,不等于条件需分别修改为:where age = '20';where age != '20';
111
    log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age = 20"));
112
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age != 20"));
112
    //log.debug("查询结果为:" + noSql.executeSelect("select * from mycol1 where age != 20"));
113
  }
113
  }
114
114