Skip to content

Commit 30dbf3c

Browse files
Merge #1249
1249: Update primary key code-samples r=bidoubiwa a=bidoubiwa based on https://github.com/meilisearch/documentation/pull/1544/files# Co-authored-by: Charlotte Vermandel <[email protected]> Co-authored-by: cvermand <[email protected]>
2 parents 9d0e008 + 5c8a7d5 commit 30dbf3c

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

.code-samples.meilisearch.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
# the documentation on build
44
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
55
---
6-
updating_guide_get_displayed_attributes_old: |-
7-
updating_guide_reset_displayed_attributes_old: |-
8-
updating_guide_check_version: |-
9-
updating_guide_create_dump: |-
10-
updating_guide_get_dump_status: |-
11-
updating_guide_get_settings: |-
12-
updating_guide_retrieve_documents: |-
13-
updating_guide_update_settings: |-
14-
updating_guide_add_documents: |-
15-
166
get_one_index_1: |-
177
client.index('movies').getRawInfo()
188
list_all_indexes_1: |-
@@ -376,16 +366,20 @@ documents_guide_add_movie_1: |-
376366
movie_id: '123sq178',
377367
title: 'Amelie Poulain'
378368
}])
369+
primary_field_guide_update_document_primary_key: |-
370+
client.updateIndex('books', {
371+
primaryKey: 'title'
372+
})
379373
primary_field_guide_create_index_primary_key: |-
380-
client.createIndex('movies', { primaryKey: 'reference_number' })
374+
client.createIndex('books', { primaryKey: 'reference_number' })
381375
primary_field_guide_add_document_primary_key: |-
382-
client.index('movies').addDocuments([
376+
client.index('books').addDocuments([
383377
{
384378
reference_number: 287947,
385-
title: 'Shazam',
386-
poster: 'https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg',
387-
overview: 'A boy is given the ability to become an adult superhero in times of need with a single magic word.',
388-
release_date: '2019-03-23'
379+
title: 'Diary of a Wimpy Kid',
380+
author: 'Jeff Kinney',
381+
genres: ['comedy','humor'],
382+
price: 5.00
389383
}
390384
], { primaryKey: 'reference_number' })
391385
getting_started_add_documents_md: |-

0 commit comments

Comments
 (0)