Skip to content

Commit c58affb

Browse files
committed
Update examples
1 parent 8fca4e9 commit c58affb

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

examples/collection_operations.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
try {
1010
$client = new Client(
1111
[
12-
'api_key' => 'xyz',
12+
'api_key' => 'jOr5q242ucEQHAbjMpu3bo6NEK5nKS00',
1313
'nodes' => [
1414
[
15-
'host' => 'localhost',
16-
'port' => '8108',
17-
'protocol' => 'http',
15+
'host' => '5wgzaxkobfc2vldtp-1.a1.typesense.net',
16+
'port' => '443',
17+
'protocol' => 'https',
1818
],
1919
],
2020
'connection_timeout_seconds' => 2,
@@ -107,29 +107,29 @@
107107
echo "--------Create Document-------\n";
108108
echo "\n";
109109

110-
// echo "--------Upsert Document-------\n";
111-
// print_r(
112-
// $client->collections['books']->documents->upsert(
113-
// [
114-
// 'id' => '1',
115-
// 'original_publication_year' => 2008,
116-
// 'authors' => [
117-
// 'Suzanne Collins',
118-
// ],
119-
// 'average_rating' => 4.34,
120-
// 'publication_year' => 2008,
121-
// 'publication_year_facet' => '2008',
122-
// 'authors_facet' => [
123-
// 'Suzanne Collins',
124-
// ],
125-
// 'title' => 'The Hunger Games',
126-
// 'image_url' => 'https://images.gr-assets.com/books/1447303603m/2767052.jpg',
127-
// 'ratings_count' => 4780653,
128-
// ]
129-
// )
130-
// );
131-
// echo "--------Upsert Document-------\n";
132-
// echo "\n";
110+
echo "--------Upsert Document-------\n";
111+
print_r(
112+
$client->collections['books']->documents->upsert(
113+
[
114+
'id' => '1',
115+
'original_publication_year' => 2008,
116+
'authors' => [
117+
'Suzanne Collins',
118+
],
119+
'average_rating' => 4.6,
120+
'publication_year' => 2008,
121+
'publication_year_facet' => '2008',
122+
'authors_facet' => [
123+
'Suzanne Collins',
124+
],
125+
'title' => 'The Hunger Games',
126+
'image_url' => 'https://images.gr-assets.com/books/1447303603m/2767052.jpg',
127+
'ratings_count' => 4780653,
128+
]
129+
)
130+
);
131+
echo "--------Upsert Document-------\n";
132+
echo "\n";
133133

134134
echo "--------Export Documents-------\n";
135135
$exportedDocStrs = $client->collections['books']->documents->export();

0 commit comments

Comments
 (0)