Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 一列数据库上的Changefeed_Java_Rethinkdb - Fatal编程技术网

Java 一列数据库上的Changefeed

Java 一列数据库上的Changefeed,java,rethinkdb,Java,Rethinkdb,我希望在java语言的RejectDB中对我的对象的一个属性有一个changefeed 我试过这个: Cursor curs = r.db("mytestdb"). table("tennis"). get(Constants.WORKING_PROJECT_ID). getField("time").

我希望在java语言的RejectDB中对我的对象的一个属性有一个changefeed

我试过这个:

Cursor curs = r.db("mytestdb").
                            table("tennis").
                            get(Constants.WORKING_PROJECT_ID).
                                getField("time").
                                changes().
                                    run(conn);
    for (Object doc : curs) {
        System.out.println(doc);
    }
但我得到了
这个com.requireddb.gen.exc.ReqlQueryLogicError:作为一个例外,无法将字符串转换为序列

我是新来的。有人能帮我吗?

getField(“time”)
获取特定的字段值,您不能按值订阅。 这就是com.db.gen.exc.ReqlQueryLogicError:无法将字符串转换为序列所说的

您可以
筛选
要获得的更改:

Cursor curs = r.db("mytestdb").
                        table("tennis").get(Constants.WORKING_PROJECT_ID)
                        .filter(row -> row.g("new_val").g("time").ne(row.g("old_val").g("time")))
                        .changes().run(conn);

for (Object doc : curs) {

}

谢谢你的帮助。我不知道你不能订阅一个值。但当我尝试将您发布的代码发送给fitler it时,我得到了这个Exeption`com.requireddb.gen.exc.ReqlQueryLogicError:预期的类型序列,但找到了单个选项:'