【发布时间】:2016-05-27 09:00:04
【问题描述】:
我无法为profile 创建索引:
var user = new Schema({
profile : "String",
fullname:"String"
})
user.statics.createIndexOfProfile = function(callback){
this.ensureIndex("profile",function(err,doc){
if(err) {
console.log(err+'sna');
callback(err);
}
else {
console.log(doc+'santhosh');
callback(null,doc);
}
});
我收到了类似this.ensureIndex is not a function的错误
【问题讨论】:
标签: node.js mongodb indexing mongoose