I'm trying to retrieve a list of documents, do something with the returned documents, then update the status to flag its been processed. This is what I have:
cursor = r.db("stuff").table("test").filter(r.row["subject"] == "books").run()
for document in cursor:
print(document["subject"])
document.update({"processed": True})
This seems to run OK but the "processed" field does not get updated as I would have expected. I'm probably approaching this incorrectly, so any pointers would be appreciated here.
UPDATE
This seems to work OK but I can't help thinking its somewhat inefficient:
cursor = r.db("stuff").table("test").filter(r.row["subject"] == "books").run()
for document in cursor:
print(document["subject"])
r.db("certs").table("test").get(document['id']).update({"tpp_processed": True}).run()