This commit is contained in:
GregTCLTK 2020-03-05 17:01:06 +01:00
parent 4484231a8c
commit 6489ad6cc5
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -53,7 +53,7 @@ public class Rethink {
private JSONArray getAsArray(String table, String where, String value) { private JSONArray getAsArray(String table, String where, String value) {
try { try {
String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn); String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn).toString();
return new JSONArray(string); return new JSONArray(string);
} catch (NoSuchElementException e) { } catch (NoSuchElementException e) {
return null; return null;
@ -77,7 +77,7 @@ public class Rethink {
} }
public JSONObject getObjectByID(String table, String id) { public JSONObject getObjectByID(String table, String id) {
String response = r.table(table).get(id).toJson().run(conn); String response = r.table(table).get(id).toJson().run(conn).toString();
return new JSONObject(response); return new JSONObject(response);
} }