When will rethinkdb return a cursor -


i notice r.table('xxx') not return cursor return docs directly

  1. is cursor client side implementation or there special things server did perform queries associate cursor?

  2. if has somethings related server, , when receive cursor

for example specify result offset , size skip , limit in query. server return cursor or result docs?

a driver returns cursor when query returns stream.

basically when server produces stream (a sequence lazily computed), driver return cursor. fetch rows cursor, server compute more elements in sequence.

for example, when run r.table('xxx'), cursor. server load documents disk request them driver.

in javascript driver, when query return array, driver sneak object mimics cursor interface between arrray , array.prototype. if query.run(...) returns sequence, can do

query.run(connection).then(function(result) {     return result.toarray() }).then(function(result) {     // result }).error(function(err) {     // handle err }) 

basically if don't want think if getting cursor or array, can consider it's cursor.

you can read more stream/cursor here:
http://www.rethinkdb.com/docs/data-types/


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -