环回4 hasMany包含过滤器错误500 [英] loopback 4 hasMany include filter Error 500

查看:52
本文介绍了环回4 hasMany包含过滤器错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照回授列表dodo-list进行一些回送4的练习 https://loopback.io/doc/zh/lb4/todo- list-tutorial.html

i am doing some practice with loopback 4, following the tutorial todo-list https://loopback.io/doc/en/lb4/todo-list-tutorial.html

我正在尝试查询凝胶待办事项列表和相关待办事项的数据

i am trying to query data to gel todo-lists and related todos

GET http://127.0.0.1:3000/todo-lists ?filter [include] = todos

我得到一个错误500:未为模型TodoList定义关系"todos"

i get an error 500 : relations "todos" not defined for the model TodoList

路由GET http://localhost:3000/todo-lists/1/todos 正常工作,但我想检索列表和相关的待办事项.

The route GET http://localhost:3000/todo-lists/1/todos works properly, but i'd like to retrieve lists and related todos.

我阅读了许多帖子和文档,但是我不明白哪里出了问题.

I read many posts and the documentation but i do not understand what is wrong.

谢谢

推荐答案

免责声明:我是共同合作者,也是LoopBack的当前维护者之一.

LoopBack 4在查询数据库时尚不支持包含相关模型.您可以加入以下GitHub问题中的讨论:

LoopBack 4 does not yet support inclusion of related models when querying the database. You can join the discussion in the following GitHub issues:

  • Inclusion of related models #1352
  • Include related models in "GET /mymodels" results #1889

请考虑通过按问题描述底部的黄色竖起大拇指按钮来解决这些问题.

Please consider upvoting those issues by pressing the yellow thumbs-up button at the bottom of issue description.

更新-2020-03-04

这些问题已更新,现在您可以实现hasMany关系.在此处

These issues have been updated and now you can implement hasMany relations. Find more info here

这篇关于环回4 hasMany包含过滤器错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆