jq filter json by dates

后端 未结 2 1382
-上瘾入骨i
-上瘾入骨i 2021-01-13 08:23

I have some json that looks like this

 {
  \"users\":[ {  
     \"id\":8734,
     \"last_login\":\"2016-10-04T06:59:40Z\"
  },
  {  
    \"id\":9376,
    \"l         


        
2条回答
  •  野的像风
    2021-01-13 08:48

    Just add the appropriate null checks.

    .users[] | select (.last_login | . == null or fromdateiso8601 > 1475625600).id 
    

提交回复
热议问题