Skip to content

Commit 8904f51

Browse files
authored
guides: push records.json location [skip-bc] (#4196)
1 parent 9531aba commit 8904f51

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

templates/csharp/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PushSetup
1111
{
1212
public static async Task Main(string[] args)
1313
{
14-
string jsonContent = File.ReadAllText("/my-raw-records.json");
14+
string jsonContent = File.ReadAllText("records.json");
1515
1616
var records = JsonSerializer.Deserialize<List<PushTaskRecords>>(jsonContent);
1717

templates/go/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func push() {
1414
// use the region matching your applicationID
1515
{{> snippets/init}}
1616

17-
content, err := os.ReadFile("/my-raw-records.json")
17+
content, err := os.ReadFile("records.json")
1818
if err != nil {
1919
panic(err)
2020
}

templates/java/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import java.util.Map;
77

88
public class pushSetup {
99
public static void main(String[] args) throws Exception {
10-
JsonNode content = new ObjectMapper().readTree(new File("/my-raw-records.json"));
10+
JsonNode content = new ObjectMapper().readTree(new File("records.json"));
1111
List<PushTaskRecords> records = new ObjectMapper().readerForListOf(Map.class).readValue(content);
1212
1313
// use the region matching your applicationID

templates/javascript/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { PushTaskRecords } from 'algoliasearch';
88

99
try {
1010
// read local JSON file containing array of records
11-
const records = JSON.parse(fs.readFileSync('/my-raw-records.json', 'utf8')) as PushTaskRecords[];
11+
const records = JSON.parse(fs.readFileSync('records.json', 'utf8')) as PushTaskRecords[];
1212
1313
// push records to the API
1414
const run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}

templates/kotlin/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlinx.serialization.json.JsonObject
1111
import java.io.File
1212

1313
suspend fun main() {
14-
val json = File("/my-raw-records.json").readText()
14+
val json = File("records.json").readText()
1515
val records: List<PushTaskRecords> = Json.decodeFromString(ListSerializer(PushTaskRecords.serializer()), json)
1616
1717
// use the region matching your applicationID

templates/php/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require(__DIR__."/vendor/autoload.php");
33
{{> snippets/import}}
44

5-
$records = json_decode(file_get_contents("/my-raw-records.json"), true);
5+
$records = json_decode(file_get_contents("records.json"), true);
66

77
// use the region matching your applicationID
88
{{> snippets/init}}

templates/python/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async def main():
77
# use the region matching your applicationID
88
_{{> snippets/init}}
99

10-
with open("/my-raw-records.json") as f:
10+
with open("records.json") as f:
1111
records = json.load(f)
1212

1313
run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}

templates/ruby/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'json'
22
{{> snippets/import}}
33

4-
records = JSON.parse(File.read('/my-raw-records.json'))
4+
records = JSON.parse(File.read('records.json'))
55

66
# use the region matching your applicationID
77
{{> snippets/init}}

templates/scala/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object PushSetup {
1414
implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global
1515
implicit val formats: org.json4s.Formats = org.json4s.DefaultFormats
1616
17-
val result = Source.fromFile("/my-raw-records.json").getLines().mkString
17+
val result = Source.fromFile("records.json").getLines().mkString
1818
val records = JsonMethods.parse(result).extract[Seq[algoliasearch.ingestion.PushTaskRecords]]
1919
2020
// use the region matching your applicationID

templates/swift/guides/ingestion/pushSetup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Core
99
func pushSetup() async throws {
1010
do {
1111
let path = URL(string: #file)!.deletingLastPathComponent()
12-
.appendingPathComponent("/my-raw-records.json")
12+
.appendingPathComponent("records.json")
1313
let data = try Data(contentsOf: URL(fileURLWithPath: path.absoluteString))
1414
let records = try JSONDecoder().decode([PushTaskRecords].self, from: data)
1515

0 commit comments

Comments
 (0)