我有一个CosmosDB集合称为plotCasts,其中有看起来像这样的对象:猫鼬查询没有返回值
{ ... "owner" : "winery", "grower" : "Bill Jones", ... }
我有以下的猫鼬的模式:当
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const plotCastSchema = new Schema({
owner: String,
grower: String,
...
});
const ModelClass = mongoose.model('plotCast', plotCastSchema);
module.exports = ModelClass;
然而,我使用下面的查询查询数据库,我得到一个空数组的结果。任何想法为什么?
PlotCast.find({ owner: 'winery' }).lean().exec(function(err, results) {
if (err) {
res.send(err);
} else if (!results) {
res.send(null);
} else {
res.send(results);
}
});
酒庄包含数据库不存在这就是为什么它来空阵列 –
@RaviTeja我不明白,你是什么意思?有一个情节播放的关键“所有者”具有“酿酒厂”的价值。 –