neumino/thinky

Problem with cursors

smashercosmo opened this issue · 2 comments

There is a possibility, that I'm doing something wrong, but this example from the docs doesn't work

User.map(r.row("id")).execute().then(function(cursor) {
    cursor.each(function(err, userId) {
        console.log(userId);
    }
})

I'm getting an error

Unhandled rejection TypeError: cursor.each is not a function

rethinkdb 2.3.4
thinky 2.3.7

I think you need cursor: true here.

User.map(r.row("id")).execute({cursor; true}).then(...)

Thx) Worth adding to docs)