77 --data-binary @movies.json
88```
99
10-
1110``` javascript JS
1211const movies = require (' ./movies.json' )
1312client .index (' movies' ).addDocuments (movies).then ((res ) => console .log (res))
1413```
1514
16-
1715``` python Python
1816import json
1917
@@ -22,15 +20,13 @@ movies = json.load(json_file)
2220client.index(' movies' ).add_documents(movies)
2321```
2422
25-
2623``` php PHP
2724$moviesJson = file_get_contents('movies.json');
2825$movies = json_decode($moviesJson);
2926
3027$client->index('movies')->addDocuments($movies);
3128```
3229
33-
3430``` java Java
3531import com.meilisearch.sdk ;
3632import org.json.JSONArray ;
@@ -44,7 +40,6 @@ Index index = client.index("movies");
4440index. addDocuments(moviesJson);
4541```
4642
47-
4843``` ruby Ruby
4944require ' json'
5045
@@ -53,7 +48,6 @@ movies = JSON.parse(movies_json)
5348client.index(' movies' ).add_documents(movies)
5449```
5550
56-
5751``` go Go
5852import (
5953 " encoding/json"
@@ -68,7 +62,6 @@ json.Unmarshal([]byte(file), &movies)
6862client.Index (" movies" ).AddDocuments (&movies)
6963```
7064
71-
7265``` csharp C#
7366// Make sure to add this using to your code
7467using System .IO ;
@@ -77,7 +70,6 @@ var jsonDocuments = await File.ReadAllTextAsync("movies.json");
7770await client .Index (" movies" ).AddDocumentsJsonAsync (jsonDocuments );
7871```
7972
80-
8173``` rust Rust
8274use meilisearch_sdk :: {
8375 indexes :: * ,
@@ -111,7 +103,6 @@ fn main() { block_on(async move {
111103})}
112104```
113105
114-
115106``` swift Swift
116107let path = Bundle.main .url (forResource : " movies" , withExtension : " json" )!
117108let documents: Data = try Data (contentsOf : path)
@@ -126,12 +117,10 @@ client.index("movies").addDocuments(documents: documents) { (result) in
126117}
127118```
128119
129-
130120``` dart Dart
131121// import 'dart:io';
132122// import 'dart:convert';
133123final json = await File('movies.json').readAsString();
134124await client.index('movies').addDocumentsJson(json);
135125```
136-
137126</CodeGroup >
0 commit comments