【发布时间】:2014-06-21 20:04:49
【问题描述】:
此代码转储到异常
self.staticVars.Model
.find({shortAddress: {$text : { $search: data.text }}, _town: data._town},{limit: 10})
.populate('_street _district')
.sort({house: 1})
.exec(callback);
例外
Can't use $text with String
型号
shortAddress: {
type: String
},
索引
collection.ensureIndex({fullAddress: 'text', shortAddress: 'text'}, { default_language: "russian" },function(){});
【问题讨论】:
标签: node.js mongodb mongoose node-mongodb-native