Comments (8)
Ok so after running the query it turns out that the returned value of the datum is actually of type atom and not sequence and because of this and how GoRethink handles the result from the server the result is not iterable in the way you are trying.
This means that you should be running RunRow
instead of Run
.
from rethinkdb-go.
But it is inconsistent. How RunRow
or Run
is depending on OrderBy
?
When I remove OrderBy
(1) then it works well.
Furthermore in JS driver everything works well and returns expected data (array of documents) - whenever if I use OrderBy
or not.
from rethinkdb-go.
I dont know why when using OrderBy the query returns an Atom(A single value) but without the OrderBy it returns a sequence as this is just how RethinkDb works. Also things work in the JS driver because the code for results it structured differently.
I will look into redoing the result code but it will require a bit of work so I will not be able to do it for a couple of days. I apologize for the wait.
from rethinkdb-go.
Maybe it is a RethinkDB bug?
from rethinkdb-go.
I think its just the way rethinkdb works
from rethinkdb-go.
Maybe we should report this? Did you inspect the internals of that query (the datum code of response)?
from rethinkdb-go.
Ill try to talk to the guys on IRC about it. And yes basically the difference is that with OrderBy a single datum is returned of type array and without an array of datums are returned which are of type object.
As I say though it shouldn't be too difficult to get the driver to convert a single datum of type array into an iterable form.
from rethinkdb-go.
Ok so I talked to some of the guys on IRC about this issue and they let me know that the use of the OrderBy causes the query to be cached in memory and because of this the result it returned as an atom.
from rethinkdb-go.
Related Issues (20)
- How to use join HOT 1
- IsEmpty result HOT 1
- v6 is opening ConnectOpts.MaxOpen connections when connecting
- Session.IsConnected not detecting disconnection HOT 8
- v6 read timeout closes connection
- Add support for Change Feed Offsets
- Connection pool performance HOT 5
- `v5` HOT 1
- Panic on session.Close()
- go mod path HOT 3
- Bug: a single string array field is returned as multiple strings. HOT 1
- data race in pool.go HOT 3
- Field("field").Field("field") nil
- Make possibility for Term to be marshalled and unmarshalled (for instance with json or yaml), so Term could be saved/loaded to/from some storage.
- Unable to connect when `TimeOut` is specified HOT 1
- Connection pool is not safe HOT 3
- Contexts not working properly in certain scenarios
- WriteResponse does not return GeneratedKeys
- Utilize MarshalJSON and UnmarshalJSON interface implementations HOT 2
- Go Lang replaces get to install. HOT 2
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 rethinkdb-go.