Skip to content

Commit 5b6b153

Browse files
Update the mongo db when post on X
1 parent 29a83d3 commit 5b6b153

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

post_tuits.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def get_one_document():
4242
create_tweet(random_item[0], x_client, x_api)
4343

4444
# Update the document to set "publicado" to True and +1 to "enviado"
45-
# collection.update_one(
46-
# {"_id": random_item[0]["_id"]},
47-
# {"$set": {"publicado": True}, "$inc": {"enviado": 1}},
48-
# )
45+
collection.update_one(
46+
{"_id": random_item[0]["_id"]},
47+
{"$set": {"publicado": True}, "$inc": {"enviado": 1}},
48+
)
4949
logging.info(f"id/_id:{random_item[0]["id"]}/{random_item[0]["_id"]}")
5050
return random_item[0]
5151
# If publicado is True, loop again to get another random item

0 commit comments

Comments
 (0)