我是路线新手,我忽略了在同一路线上选择两个 id 的常见模式。
I've products id and when a product is selected the user can select subproducts, services, etc on this product and then create, edit, etc.
来自服务、子产品等的每个 Mongo 文档都保存了与它们相关的产品的 ID。
实现这一点的方法是使用 2 id 的路线: /{product_id}/{subproduct_id}/edit ?我必须为每条路线都这样做吗?那么我是否必须在每个 waitOn (产品和子产品)中调用 2 个订阅?
是否有另一种更好的方法,我可以先获取产品集合,然后在 waitOn 内只订阅 1 个子产品路线?使用会话?
谢谢