Comments (4)
Getting a cursor is actually the expected outcome, though I agree it's not very intuitive. Cursors implement Seqable so you can for example turn it into a vector with into []
or use take
to avoid loading the entire result set.
Examples are very lacking and I'm too lazy to write them. Perhaps the best way for now is to look at the tests.
from clj-rethinkdb.
Oh. Sorry — I read the RethinkDB tutorial on table joins and they show the pretty {"left": {...}, "right": {...}} output, without mentioning a cursor once. It turns out that one can learn about cursors by digging deeper into JavaScript API documentation.
I did look at the tests, but for example for indexes they also only contain a fairly simple example of an index created using a custom function.
Like I said, I'm willing to do some work on this, but I can't find a good way to get started. I've been banging my head against a wall for a while now, and the only way forward that I can see is to start back from the JSON protocol and work back through the code from there, trying to figure out what the Clojure form of rdb commands is. Can you suggest a better approach?
from clj-rethinkdb.
The client is pretty much a direct mapping of the underlying JSON protocol so I guess https://github.com/rethinkdb/rethinkdb/blob/v2.0.x/src/rdb_protocol/ql2.proto could be useful. Either that or reading query.clj.
The same functions are used for creating indexes and querying, so the syntax for creating a secondary index on a nested field is the same as get on a nested field.
Is there anything else you've been having trouble with?
from clj-rethinkdb.
No, thanks — I'm figuring things out from the ground up and making progress. I will probably make a pull request in a while, with expanded examples, so that others have an easier start. I think this issue can be closed.
BTW, the idea that I should get a structure with "left" and "right" fields was from a RethinkDB tutorial, this is why I was surprised that I got a cursor. That cursor additionally explodes in your face once it goes out of (with-open) connection scope, so it's a double whammy.
from clj-rethinkdb.
Related Issues (20)
- RethinkDB 2.3 handshake V1.0 implementation
- Unwanted stacktraces HOT 8
- View rethink queries as JS? HOT 2
- Improve performance of byte handling HOT 1
- add a `grant` method HOT 7
- add r/expr term HOT 3
- Dependency on Aleph and Netty causes issues deploying to wildfly and jboss HOT 10
- SocketException: Address already in use: /127.0.0.1:28015 HOT 1
- Call to clojure.core/refer-clojure did not conform to spec HOT 2
- Ability to use index in distinct HOT 1
- rethinkdb.query/term? should be public HOT 1
- Any reason not to use protobuf-java 3.0.2? HOT 2
- how to use nested without? HOT 2
- `:temp-var` leaks into query result
- closed connection is not detected
- r/branch support multiple conditions
- Arrays in optargs
- sorted-set is not supported and causes exceptions to be thrown
- Communication with RethinkDB freezing/hanging completely HOT 5
- rethinkdb.net/deliver-result tries to conj to ex-info, which fails HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-rethinkdb.