GithubHelp home page GithubHelp logo

rethinkjava's People

Contributors

artichikin avatar dkhenry avatar janih avatar kclay avatar oscerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rethinkjava's Issues

Inserting null throws error

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!

insert's optional parameter is not working.

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

(may be not Issue) How to Convert cursor of get_all() into Map or list map or json string

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.

Exception during insert in case in map exists transformed by google collections2 utility collection

Environment:

  1. OpenJDK 1.7
  2. RethinkDB java driver 0.3
  3. Guava 17.0

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)

get_all fails on Rethink 2.0.1

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.

How to implement Lambda function?

Sorry Again I am confused because there is no any documentation, I did not find anything, is it already possible to use Lambda function?

version compatibility clarification

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.