1

我正在使用 mongoosastic npm 模块。在截断索引时我得到

TypeError: Unable to build a path with those params. Supply at least index

我正在使用的代码

对于截断:

var tagModelJS = require('../DaoModel/TagModel.js');
var TagModel = tagModelJS.getTagModel();

TagModel.esTruncate(function (err) {

    if (err) {

        console.log("ERROR : while removing data from elastic search.")
        throw err;
    }

});

标签型号:

var TAGS;
module.exports = {
    createSchemaAndGetModel : function (mongoose, mongoosastic, Schema) {
        //create schema
        var tagSchema = new Schema({
                tagDetail : String,
                userIds : [], //list of user ids
                tagName : {
                    type : [String],
                    es_indexed : true
                } // field level
            });
        tagSchema.plugin(mongoosastic)
        //create model
        TAGS = mongoose.model('TAGS', tagSchema);

        console.log("Tag model ready....");
       },

        getTagModel : function () {
            return TAGS;
        }
       };

任何帮助将不胜感激。

4

0 回答 0