fix scripted-and-runtime-fields.adoc

Original Pull Request #2902
Closes #2903
This commit is contained in:
Mingron 2024-04-27 17:13:58 +08:00 committed by GitHub
parent 106b513d11
commit 1d89054d12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,7 +194,7 @@ In the following code this is used to run a query for a given gender and maximum
var runtimeField = new RuntimeField("age", "long", """ <.>
Instant currentDate = Instant.ofEpochMilli(new Date().getTime());
Instant startDate = doc['birth-date'].value.toInstant();
Instant startDate = doc['birthDate'].value.toInstant();
emit (ChronoUnit.DAYS.between(startDate, currentDate) / 365);
""");