Skip to content

Commit cc927fc

Browse files
committed
docs: update field name
1 parent 7d4fe66 commit cc927fc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/source/examples/database/basic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ then you can see the file content as like the following,
163163
{
164164
"created_at": "2022-12-25T16:50:02.459068",
165165
"creator": "json_as_db",
166-
"records": {
166+
"data": {
167167
"AwMJDzrjkpWJCee5iSozXW": {
168168
"type": "Orange"
169169
}

docs/source/examples/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ can deal with this object just like dictionary.
3434
.. code-block:: python
3535
3636
>>> await client.create_database('sample')
37-
{'records': {}, 'creator': 'json_as_db', 'created_at': '2022-12-25T14:23:28.906103', 'version': '1.0.0', 'updated_at': '2022-12-25T14:23:28.906103'}
37+
{'data': {}, 'creator': 'json_as_db', 'created_at': '2022-12-25T14:23:28.906103', 'version': '1.0.0', 'updated_at': '2022-12-25T14:23:28.906103'}
3838
3939
4040
Get Database from file
@@ -50,7 +50,7 @@ following example, `Client` read the file from ``path/dir/sample.json``.
5050
.. code-block:: python
5151
5252
>>> await client.get_database('sample')
53-
{'records': {}, 'creator': 'json_as_db', 'created_at': '2022-12-25T14:23:28.906103', 'version': '1.0.0', 'updated_at': '2022-12-25T14:23:28.906103'}
53+
{'data': {}, 'creator': 'json_as_db', 'created_at': '2022-12-25T14:23:28.906103', 'version': '1.0.0', 'updated_at': '2022-12-25T14:23:28.906103'}
5454
5555
5656
Remove Database

tests/database/test_database.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ def test_db_modify_wrong_params(db: Database):
160160

161161

162162
def test_db_all(db: Database):
163-
records = db.all()
164-
logger.debug(records)
165-
assert len(records) == 2
166-
cat_names = set(map(lambda rec: rec['randomString'], records))
163+
items = db.all()
164+
logger.debug(items)
165+
assert len(items) == 2
166+
cat_names = set(map(lambda rec: rec['randomString'], items))
167167
expected = set(['keyboard-cat', 'cheshire-cat'])
168168
assert expected == cat_names
169169

0 commit comments

Comments
 (0)