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'嗎? –
我明白了,謝謝。我已經標記了你的答案。 –