[英]How can i call query with parameter and then populate using dynamoose
var added = await Feature.scan("parentId").eq(baseIds).exec()
.then(function (add) {
return add.populate({
path: 'parentId',
model: 'Feature'
})
})
我已經安裝了使用Dynamoose的服務器。 我想對一個值字段的基礎進行查詢,然后填充,但是我無法使用dynamoose api docs中的解決方案來實現它。
根據Dynamoose文檔 :
Dog.scan().exec()
.then(function(dogs) {
return Promise.all(dogs.map(function(dog) {
return dog.populate({
path: 'parent',
model: 'Dog'
});
}));
})
.then(function(dogs) {
console.log(dogs);
});
由於掃描為您提供了一系列對象,因此您必須分別填充每個項目並等待所有這些諾言成功。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.