The Wayback Machine - https://web.archive.org/web/20201015014244/https://github.com/APIJSON/APIJSON/issues/139
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于引用赋值操作符的问题? #139

Open
RichardsATcn opened this issue Jul 9, 2020 · 1 comment
Open

关于引用赋值操作符的问题? #139

RichardsATcn opened this issue Jul 9, 2020 · 1 comment

Comments

@RichardsATcn
Copy link

@RichardsATcn RichardsATcn commented Jul 9, 2020

我通过 请求到一个Array后,在这个Array中的 每个Item的某个值继续进行查询 再次得到一个Array。最后进行一个Array的查询需要应用上一层的的值,这个id@ 后面的引用应当如何编写。
如下 8行的位置会得到一个包含lid的 Array。 15行如何应用这里的lid
请求下来的代码段中 12行 和 15行 中的 22 23 这两个值我如何去索引

请求JSON如下:


1. {
2.     "[]": {
3.         "page": 10,
4.         "count": 1,
5.         "Lquestions": {},
6.         "Lquestion_label[]": {
7.             "Lquestion_label": {
8.                 "qid@": "[]/Lquestions/qid"
9. //查询到lid的 列表
10.             }
11.         },
12.         "Llabels[]": {
13.             "Llabels": {
14. //如何引用 Lquestion_label 得到的lid 列表中的值进行查询
15.                 "id@": "/Lquestion_label[]/Lquestion_label/lid"
16.             }
17.         }
18.     }
19. }

上述JSON 请求下来后得到的回复:


1. {
2. "[]":  [
3.  {
4. "Lquestions":  {
5. "qid": 11 ,
6. "uid": 505 ,
7. "catid": 4 ,
8. "qtid": 4 ,
9. },
10. "Lquestion_label[]":  [
11.  {
12. "lid": 22
13. },
14.  {
15. "lid": 23
16. }
17. ]
18. }
19. ],
20. "ok": true ,
21. "code": 200 ,
22. "msg": "success" ,
23. "sql:generate|cache|execute|maxExecute": "4|2|2|200" ,
24. "depth:count|max": "5|5" ,
25. "time:start|duration|end": "1594285962514|5|1594285962519"
26. }

@TommyLemon
Copy link
Member

@TommyLemon TommyLemon commented Jul 11, 2020

用子查询,见项目 通用文档

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.