Neurosis Prevention Mechanism
    Have ideas to improve npm?Join in the discussion! »

    mongoose-fulltext-plugin

    1.0.4 • Public • Published

    mongoose-fulltext-plugin

    N-gram based searching for mongoose models

    David npm MIT NPM Version

    Installation

    $ npm install --save mongoose-fulltext-plugin

    Usage

    const mongoose = require('mongoose');
    const fulltext = require('mongoose-fulltext-plugin');
     
    const schema = new Schema({
        title: String,
        description: String
    });
     
    schema.plugin(fulltext);
    const Model = mongoose.model('YourModelName', schema);
     
    Model.search('custom text').then(...);

    Plugin Options

    • fields - array of document fields to be used for computing n-grams. All string fields by default.
    • stemmer - function to be used for computing word stem. stemmer by default.

    Install

    npm i mongoose-fulltext-plugin

    DownloadsWeekly Downloads

    6

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • avatar