How get Year only in the api json

Here I created an API in which I getting the average value and year in the from the table column createdAt. public async Task<ICollection<SchoolSystemOverallAveragePerYearVm>> GetSchoolSystemOverallAveragePerYear(Guid schoolSystemId) { var schoolsystemYearAvg = _GpsContext.SchoolSystem.Where(s => s.Id == schoolSystemId); var tem = _GpsContext.AssignmentStudents .Include(a => a.Assignment) .ThenInclude(s => s.SchoolSystems) .GroupBy(g => // Group by your Key-Values Grade and Course…

Choropleth map based on date from geojson using mapbox-gl-js

Here is my code: ‘fill-color’: { property: ‘date’, stops: [ [‘1920-12-31’, ‘#faa476’], [‘1940-12-31’, ‘#f0746e’], [‘1960-12-31’, ‘#e34f6f’], [‘1980-12-31’, ‘#dc3977’], [‘2000-12-31’, ‘#b9257a’], [‘2020-12-31’, ‘#7c1d6f’] ] }, Date property contains dates in format YYYY-MM-DD, but map doesn’t work. Could anybody say what am I doing wrong?

com.jayway.jsonpath and Weblogic 12c

In my Spring-Boot project I use this dependency: <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <version>2.0.0</version> </dependency> This dependency uses internally the dependency json-smart 2.3. When I try to deploy my project in Weblogic 12C I get following error: java.lang.NoSuchFieldError: defaultReader at com.jayway.jsonpath.spi.json.JsonSmartJsonProvider.<init> (JsonSmartJsonProvider.java:39) at com.jayway.jsonpath.internal.DefaultsImpl.jsonProvider(DefaultsImpl.java:21) at com.jayway.jsonpath.Configuration.defaultConfiguration(Configuration.java:174) at com.jayway.jsonpath.internal.JsonContext.<init>(JsonContext.java:52) at com.jayway.jsonpath.JsonPath.parse(JsonPath.java:596) I have already tried the solutions proposed…

How to parse json object from string line?

I’m new to logstash. I would like to parse every line in log file as json object using grok. My log looks like this: 1570519737247 I access {“date”:”2019-10-08T09:28:57.247″,”rootTitle”:”title1″,”rootModel”:”model1″,”dcTitle”:”[1a]”} 1570519737247 I access {“date”:”2019-10-08T09:28:57.247″,”rootTitle”:”title2″,”rootModel”:”model2″,”dcTitle”:”[1b]”} You can see that every line is starting with text and then there is valid json object. And I want to construct object…

Jsonpath return null for nested JSON objects in Spring Boot Test

In a Spring Boot test I need to compare/matching the result from a call to a rest controller with a Java entity previously created that have nested objects. This is the Java entity: @Entity @Table(name=”Referente”) public class Referente { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = “idReferente”, updatable = false, nullable = false) private Integer idReferente;…

JSON1 support go-sqlite3 using gorm

In the following example I use json_extract(…) using the go-sqlite3 driver in Golang. package main import ( _ “github.com/mattn/go-sqlite3” “github.com/jinzhu/gorm” _ “github.com/jinzhu/gorm/dialects/sqlite” “fmt” “encoding/json” “net/http” ) func main() { var db *gorm.DB type Session struct { gorm.Model SessionID string `json:”session_id”` Options string `json:”options”` } db, err := gorm.Open(“sqlite3”, “./app.db”) if err != nil { fmt.Println(err)…