{ "data": { "callOrders": [{ "promotionId": null, "Promotion": null, "Lines": [{ "id": 5105808, "quantity": 10, "skuId": 769, "callId") ": 494285,"skuBatchId ": 733,"amountDetails ": {"rate ": 197.53,"grossAmount ": 2232.089,"netAmount ": 2232.089,"taxAmount ": 256.789,"taxableAmount ": 1975.3,"subTotal ": 1975.3 , "billDiscount": 0, "tradeDiscount": 0, "discountAmount": 0, "promotionDiscount": 0, "topUpDiscount": 0, "__typename": "AmountDetail"}, "rateDetails": { "rlp": 197.53 , "rlpWithVat": 223.2089, "netPrice": 197.53, "netPriceWithVat": 223.2089, "__typename ":"RateDetail "},"SKU ": {"id ": 769,"title ":"H & S 2in1 Active Protect 180ml x 24 [82302894] ","__typename ":"SKU "},"SKUBatch ": { "priceDetails": { "rlp": 197.53, "dlp": 186.35, "vatPercentage": 0.13, "mrpSrp": 250, "mrpStatus": true, "__typename": "SKUPrice"}, "batchDetails": { "batchNumber": "DEFAULT_BATCH", "__typename": "SKUBatch"}, "usageDate": { "manufacture": "0000-00-00", "expiry": "0000-00-00", "__typename": "SKUUsage"}, "updatedAt": "2019-11-05", "active": true, "__typename": "SKUBatchRate "},"Promotion ": {"id ": null,"title ": null,"type ": null,"scope ": null,"criteria ": null,"__typename ":"Promotion "},"promotionId ": null,"distributorId ": 16,"__typename ":"Line ","inStock ":"INSTOCK ","freeSku ": false,"focusedSku ": false}, {"id ": 5105809,"quantity ": 50, "skuId": 95, "callId": 494285, "skuBatchId": 111, "amountDetails": { "rate": 56.89, "grossAmount": 3214.2852, "netAmount": 3214.285, "taxAmount": 369.785, " taxableAmount ": 2844.5,"subTotal ": 2844.5,"billDiscount ": 0,"tradeDiscount ": 0,"discountAmount ": 0,"promotionDiscount ": 0,"topUpDiscount ": 0,"__typename ":"AmountDetail "},"rateDetails ": {"rlp ": 56.89,"rlpWithVat ": 64.2857,"netPrice ": 56.89," netPriceWithVat ": 64.2857,"__typename ":"RateDetail "},"SKU ": {"id ": 95,"title ":"Whisper Choice 6s x 96 [82252488] ","__typename ":"SKU "}," SKUBatch ": {"priceDetails ": {"rlp ": 56.89,"dlp ": 53.67,"vatPercentage ": 0.13,"mrpSrp ": 72,"mrpStatus ": true,"__typename ":"SKUPrice "},"batchDetails ": {"batchNumber ":"DEFAULT_BATCH ","__typename ":"SKUBatch "},"usageDate ": {"manufacture ":"0000-00-00 ","expiry ":"0000-00-00 ","__typename ":"SKUUsage "},"updatedAt ":"2016-08-15 "," active ": true,"__typename ":"SKUBatchRate "},"Promotion ": {"id ": null,"title ": null,"type ": null,"scope ": null,"criteria ": null," __typename ":"Promotion "},"promotionId ": null,"distributorId ": 16,"__typename ":"Line ","inStock ":"INSTOCK ","freeSku ": false,"focusedSku ": false}, { "id": 5105810, "quantity": 10, "skuId": 82, "callId": 494285, "skuBatchId": 551, "amountDetails": { "rate ": 281.88,"grossAmount ": 3185.244,"netAmount ": 3185.244,"taxAmount ": 366.444,"taxableAmount ": 2818.8,"subTotal ": 2818.8,"billDiscount ": 0,"tradeDiscount ": 0,"discountAmount " : 0, "promotionDiscount": 0, "topUpDiscount": 0, "__typename": "AmountDetail"}, "rateDetails": { "rlp": 281.88, "rlpWithVat": 318.5244, "netPrice": 281.88, "netPriceWithVat" : 318.5244, "__typename": "RateDetail"}, "SKU": { "id": 82, "title": "Ariel Oxyblu 1kg x 24 [82250306]", "__typename": "SKU"}, "SKUBatch ": {"priceDetails ": {"rlp ": 281.88,"dlp ": 268.45,"vatPercentage ": 0.13,"mrpSrp ": 344,"mrpStatus ": true,"__typename ":"SKUPrice "},"batchDetails ": {"batchNumber ":"DEFAULT_BATCH ","__typename ":"SKUBatch "},"usageDate ": {"manufacture ":"0000-00-00 ","expiry ":"0000-00-00 ","__typename ":"SKUUsage "},"updatedAt ":"2018-01-31 ","active ": true,"__typename ":"SKUBatchRate "},"Promotion ": {"id ": null,"title ": null,"type ": null,"scope ": null,"criteria ": null,"__typename ":"Promotion "},"promotionId ": null,"distributorId ": 16,"__typename ":"Line ","inStock ":"INSTOCK ","freeSku ": false,"focusedSku ": false}],"__typename ":"PromotionOrder "}]}}
$ .. Lines..id 사용하면 [5105808, 769, null, 5105809, 95, null, 5105810, 82, null]
하지만 가치를 얻고 싶습니다 [5105808, 5105809, 5105810]. 그것을 달성하는 방법은 무엇입니까?
당신이 사용하고 ..
인 세부 검색 연산자 모든 찾고하지 않았 음을 의미합니다 id
그들이 JSON에 위치하고있어 위치에 관계없이 속성 값.
객체 id
의 직계 자식 인 속성 만 가져 오려면 Lines
쿼리를 다음과 같이 수정해야합니다.$..Lines[*].id
데모:
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다