Code Monkey home page Code Monkey logo

Comments (8)

dancannon avatar dancannon commented on May 29, 2024

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.

robert-zaremba avatar robert-zaremba commented on May 29, 2024

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.

dancannon avatar dancannon commented on May 29, 2024

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.

robert-zaremba avatar robert-zaremba commented on May 29, 2024

Maybe it is a RethinkDB bug?

from rethinkdb-go.

dancannon avatar dancannon commented on May 29, 2024

I think its just the way rethinkdb works

from rethinkdb-go.

robert-zaremba avatar robert-zaremba commented on May 29, 2024

Maybe we should report this? Did you inspect the internals of that query (the datum code of response)?

from rethinkdb-go.

dancannon avatar dancannon commented on May 29, 2024

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.

dancannon avatar dancannon commented on May 29, 2024

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)

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.