dkhenry / rethinkjava Goto Github PK
View Code? Open in Web Editor NEWJava/JVM Drivers for RethinkDB ( rethinkdb.com )
License: Other
Java/JVM Drivers for RethinkDB ( rethinkdb.com )
License: Other
It's unclear how to insert binary data using this driver. http://rethinkdb.com/api/javascript/binary/
Hello Daniel!
I'm using version 0.6
If value in Map is null it can not be inserted:
example:
Map a = new HashMap();
a.put("b", null);
r.run(r.db("myDb").table("myTable").insert(a));
throws:
java.lang.NullPointerException
at com.dkhenry.RethinkDB.Datum.datum(Datum.java:41)
at com.dkhenry.RethinkDB.RqlQuery$Datum.build(RqlQuery.java:345)
at com.dkhenry.RethinkDB.RqlQuery.build(RqlQuery.java:319)
at com.dkhenry.RethinkDB.RqlQuery.build(RqlQuery.java:315)
at com.dkhenry.RethinkDB.RqlConnection.run(RqlConnection.java:60)
Thanks for great work!
I have seen that when we insert simple json, it works, but when we use optional parameter in json like:
table.insert(json | [json][, {durability: "hard", returnVals: false, upsert: false}])
it produce error:
r_str: "Expected 2 argument(s) but found 3."
the second parameter is also in java Hashmap
Thanks.
I have problem to convert value from get_all(array) in string(as json) or Map.
RqlCursor cursor = r.db("test").table("x").get_all(arraylist)
when I try to fetch like
for(RqlObject o : cursor) {
if (o instanceof java.util.List<?>) {
List<Object> list = o.getList();
}else if (o instanceof ListIterator<?>) {
List<Object> list = o.getList();
}else {
java.util.Map<String, Object> map = o.getMap();
}
}
None of other instances than Map
catches above condition and generated error java.util.ArrayList cannot be cast to java.util.Map
How can I get this Object in map or array of list map or even in json formatted string.
Environment:
Run following code:
RethinkDB rd=RethinkDB.r;
RethinkDBConnection con = rd.connect("172.16.140.63");
Map map1=new HashMap();
map1.put("id", new UUID(221L, 2L).toString());
Map map2=new HashMap();
map2.put("ccc", "ddd");
ArrayList<Map> originalList = Lists.newArrayList(map2,map2);
Collection<Map> convertedList=Collections2.transform(originalList, new Function<Map, Map>(){
@Override
public Map apply(Map f) {
return f;
}
});
map1.put("innerListOfMap", convertedList);
rd.table("test").insert(map1,Durability.soft, Boolean.FALSE, Boolean.TRUE).run(con);
con.close();
Result: Will throw exception:
com.rethinkdb.RethinkDBException: Unknown Value can't create datatype for : class java.util.HashMap
at com.rethinkdb.ast.query.RqlUtil.createDatum(RqlUtil.java:149)
at com.rethinkdb.ast.query.RqlUtil.createDatum(RqlUtil.java:142)
at com.rethinkdb.ast.query.gen.Datum.toTerm(Datum.java:17)
at com.rethinkdb.ast.query.RqlQuery.toTerm(RqlQuery.java:86)
at com.rethinkdb.ast.query.RqlQuery.toTerm(RqlQuery.java:80)
at com.rethinkdb.ast.query.RqlQuery.toTerm(RqlQuery.java:80)
at com.rethinkdb.ast.query.RqlQuery.run(RqlQuery.java:95)
at com.rethinkdb.ast.query.gen.Insert.run(Insert.java:25)
....
Expected: I think should not throw exceptions since com.google.common.collect.Collections2$TransformedCollection -regular collection (extends java.util.AbstractCollection)
Doesn't it make sense to add them since they'll rarely change and then you won't force users to install an additional toolchain?
I'm seeing a result with status SUCCESS_SEQUENCE being returned by the get_all operation, causing the cursor to prematurely return with an empty result set. Let me know if you can't reproduce this. This is a very preliminary finding on my part.
Sorry Again I am confused because there is no any documentation, I did not find anything, is it already possible to use Lambda function?
Hi @dkhenry,
Could you clarify what you mean in the readme "status" subheading by, "API version 1.0 and 2.0"? I cannot find any information about what the (I assume, RethinkDB) API version corresponds to.
It's not clear to me, given your comment in parentheses, "RethinkDB 1.5 .. 1.11", whether this driver is compatible with RethinkDB v2.0.x.
Thanks in advance for your time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.