Hiperfly
Hiperfly

Reputation: 178

Rethinkdb: Changefeed - > How to look at/return 2 fields?

I have a table where each row has 10 different fields, but for a certain Changefeed I'm using I'm only interested in looking if there is a change in one of the fields, but return two of them.

For instance, if I have a table with the rows [id, name, age, height] I'd want to see all the changes made only in age (I don't care about the height changes) and I want the cursor to return both the fields Name and age.

I know that to look at one field I can do:

r.table('Customers').get_all(*list_of_customers*).get_field('age').changes.run()

but this wouldn't return the ID or the Name.

Is there a way to do this?

Thanks

Upvotes: 0

Views: 63

Answers (1)

Stock Overflaw
Stock Overflaw

Reputation: 3321

You can use pluck, which accepts several fields, instead of get_field.

Upvotes: 1

Related Questions