根據文檔教授here在「閱讀NoSQL文檔」部分下。Couchbase find()錯誤
我複製了下面完全相同的代碼。
UserModel.find({}, function(error, result) {
if(error) {
console.log("An error happened -> " + JSON.stringify(error));
}
// Do something with the resulting Ottoman models
});
但它給我的錯誤
TypeError: First argument needs to be a ViewQuery, SpatialQuery or N1qlQuery.
爲什麼會產生這個錯誤嗎?什麼是ViewQuery
,SpatialQuery
和N1qlQuery
?
「上述內容可以找到使用Ottoman UserModel創建的所有文檔。」您是否使用Ottoman UserModal創建了文檔? –
@AlexisCôté是的我很確定我在使用奧斯曼創建的桶上有文檔。 – CENT1PEDE