Skip to content

Commit f7111d6

Browse files
authored
ARROW-141 Fix array and document Quickstart examples (#122)
1 parent 790095a commit f7111d6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bindings/python/docs/source/quickstart.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ query. We can do so using **PyMongo**::
5151
from pymongo import MongoClient
5252
client = MongoClient()
5353
client.db.data.insert_many([
54-
{'_id': 1, 'amount': 21, 'last_updated': datetime(2020, 12, 10, 1, 3, 1)},
55-
{'_id': 2, 'amount': 16, 'last_updated': datetime(2020, 7, 23, 6, 7, 11)},
56-
{'_id': 3, 'amount': 3, 'last_updated': datetime(2021, 3, 10, 18, 43, 9)},
57-
{'_id': 4, 'amount': 0, 'last_updated': datetime(2021, 2, 25, 3, 50, 31)}])
54+
{'_id': 1, 'amount': 21, 'last_updated': datetime(2020, 12, 10, 1, 3, 1), 'account': { 'name': "Customer1", 'account_number': 1}}, "txns": [1, 2, 3]},
55+
{'_id': 2, 'amount': 16, 'last_updated': datetime(2020, 7, 23, 6, 7, 11), 'account': { 'name': "Customer2", 'account_number': 2}}, "txns": [1, 2, 3]},
56+
{'_id': 3, 'amount': 3, 'last_updated': datetime(2021, 3, 10, 18, 43, 9), 'account': { 'name': "Customer3", 'account_number': 3}}, "txns": [1, 2, 3]},
57+
{'_id': 4, 'amount': 0, 'last_updated': datetime(2021, 2, 25, 3, 50, 31), 'account': { 'name': "Customer4", 'account_number': 4}}, "txns": [1, 2, 3]}])
5858

5959
Defining the schema
6060
-------------------
@@ -79,7 +79,7 @@ Nested data (embedded documents) are also supported::
7979
Arrays (and nested arrays) are also supported::
8080

8181
from pymongoarrow.api import Schema
82-
schema = Schema({'_id': int, 'amount': float, 'account': list_(int32())})
82+
schema = Schema({'_id': int, 'amount': float, 'txns': list_(int32())})
8383

8484
.. note::
8585

@@ -119,7 +119,7 @@ Nested data (embedded documents) are also supported::
119119
Arrays (and nested arrays) are also supported::
120120

121121
from pymongoarrow.api import Schema
122-
schema = Schema({'_id': int, 'amount': float, 'account': list_(int32())})
122+
schema = Schema({'_id': int, 'amount': float, 'txns': list_(int32())})
123123
arrow_table = client.db.data.find_arrow_all({'amount': {'$gt': 0}}, schema=schema)
124124

125125
Aggregate operations

0 commit comments

Comments
 (0)