1
我正在使用ionic 3和Baqend为BaaS构建一个应用程序。使用Baqend检索嵌套数据 - undefined
如果我有以下数据:
product :{
id: xxx,
item: {
name: "Name",
description: "product details.."
}
}
如何检索 'item.name' 的价值?
我试过以下,但给我'未定义'。它适用于如果我做product.id
但不是嵌套数据的情况。
import { baqend } from "baqend";
...
db: baqend;
...
this.db.Products.find().resultList(function(results) {
results.forEach(function(product) {
console.log(product.item.name);
});
});
我下面的Baqend指南: https://www.baqend.com/guide/topics/queries/
我明白了。我实际上是使用类型'列表'的项目。我需要首先在什么地方声明'ProductItem'吗? –
我明白了,谢谢。我已经标记了你的答案。 –