JQ |连接命令

时间:2017-03-10 11:42:38

标签: pipeline jq

有没有办法可以在一个jq命令中连接这些js的命令?

import { Request, RequestOptionsArgs, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';    

export const HttpServiceMockup = {

  json = // get data from json file

  request(url: string | Request, options?: RequestOptionsArgs): Observable<Response> {
    // based on the passed url return some data from the json
    // and wrap that data in a Observable of Response.

     if (url.url.indexOf('someUrl')>-1){
        return Observable.of(data);
     }
    return null;
  }

};

非常感谢。

1 个答案:

答案 0 :(得分:1)

jq -c '.[] | {a: .children[1].text, f: .children[0].text} | select(.a != null) | select(.f != null) | [.a, [.f,(.f | length)]]'