• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Angela2022
V2EX  ›  程序员

请问: JS 中对嵌套的 Json 对象进行查询和提取内容有啥好的工具?

  •  
  •   Angela2022 · Oct 1, 2022 · 1118 views
    This topic created in 1331 days ago, the information mentioned may be changed or developed.

    问题 1: 对浅层嵌套的 Json 对象进行查询和提取内容:

    现在我用解构和递归两种方法, 感觉不直观, 有啥更好的办法?

    问题 2: 对深层嵌套的 Json 对象进行查询和提取内容:

    现在我用递归, 感觉很复杂, 有啥现成的工具或 js 库能帮忙吗?

    谢谢!

    wxf666
        1
    wxf666  
       Oct 1, 2022
    JSONPath ?

    在线尝试: http://jsonpath.com/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 13:13 · PVG 21:13 · LAX 06:13 · JFK 09:13
    ♥ Do have faith in what you're doing.