Skip to content

Commit de94c8a

Browse files
authored
docs: update README
1 parent 90d19d7 commit de94c8a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@
55
Using JSON as very lightweight database
66

77
```python
8-
>>> db = client.create_database('table_1')
9-
>>> db.add([{
10-
... "id": "1001",
11-
... "type": "Regular"
12-
... }, {
8+
>>> db = Database()
9+
>>> db.load('output.json') # Load database from file
10+
>>> db.add([{ # Add items what you want to add
1311
... "id": "1002",
1412
... "type": "Chocolate"
1513
... })
1614
['FqkmbYFSCRCAHQWydhM69v', 'RUJGcVBFANvNRReXa8U3En']
17-
>>> db.save(json_kwds={'indent': 4})
15+
>>> db.save('output.json', json_kwds={'indent': 4}) # Just save it into file.
1816
```
1917

2018
```js
21-
// table_1.json
19+
// output.json
2220
{
2321
"created_at": "2022-12-25T16:50:02.459068",
2422
"creator": "json_as_db",
@@ -32,7 +30,7 @@ Using JSON as very lightweight database
3230
"type": "Chocolate"
3331
}
3432
},
35-
"updated_at": "2022-12-25T16:51:36.276790",
33+
"updated_at": "2022-12-28T16:51:36.276790",
3634
"version": "1.0.0"
3735
}
3836
```

0 commit comments

Comments
 (0)