Question

I am using Rethinkdb Java driver, How can I convert RqlCursor to Map in java?

 RqlCursor cur = r.db("test").table("x").insert({"a":"b"})

How to convert this cur to Hashmap or Map?

Was it helpful?

Solution

You can iterate the cursor for query results and there is a getMap method in the result object

That insert query returns certain attributes, you can retrieve them for example like this:

for(RqlObject o : cur) {
    o.getAs("inserted").toString();
    o.getAs("replaced").toString();
    o.getAs("unchanged").toString();
    o.getAs("errors").toString();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top