1
0
mirror of https://github.com/ltcptgeneral/cs239-caching.git synced 2025-10-22 12:09:20 +00:00

Add to db instead of creating new one

This commit is contained in:
HiccupHan
2025-02-22 19:55:26 -08:00
parent b5e6f5eb9f
commit 5dc9a99a3a
4 changed files with 9057 additions and 30 deletions

@@ -28,7 +28,7 @@ def init_db():
# Prepopulate database with some sample users if empty
if len(db) == 0:
db.insert_multiple([
{"user_id": "1", "name": "Alice", "followers": 100, "bio": "Love coding!", "posts": "Hello, world!"},
{"user_id": "2", "name": "Bob", "followers": 200, "bio": "Tech enthusiast", "posts": "AI is amazing!"},
{"user_id": "3", "name": "Charlie", "followers": 50, "bio": "Blogger", "posts": "Check out my latest post!"}
{"user_id": "1", "name": "Alice", "followers": 100, "bio": "Love coding!", "posts": "Hello, world!", "friends": ["2"]},
{"user_id": "2", "name": "Bob", "followers": 200, "bio": "Tech enthusiast", "posts": "AI is amazing!","friends": ["3", "1"]},
{"user_id": "3", "name": "Charlie", "followers": 50, "bio": "Blogger", "posts": "Check out my latest post!", "friends": ["1"]}
])