Chet
Chet

Reputation: 19889

How to get initial documents when calling cursor.changes() with RethinkDB

The docs are explicitly vague about this:

http://rethinkdb.com/docs/changefeeds/javascript/

Point changefeeds will always return initial values and have an initializing state; feeds that return changes on unfiltered tables will never return initial values. Feeds that return changes on more complex queries may or may not return return initial values, depending on the kind of aggregation.

Is there a way to force the initial documents through the changes feed?

Suppose I have an arbitrary query. We can call query.changes.run(//...) and get the change feed, but I want to make sure I get the initial documents. At the very least, I want consistency!

Upvotes: 0

Views: 63

Answers (1)

mlucy
mlucy

Reputation: 5289

Currently there's no optarg you can put there to get that, but in the 2.2 release you'll be able to use the include_initial optarg for that: https://github.com/rethinkdb/rethinkdb/issues/3579 .

Upvotes: 1

Related Questions