JSPM

mongoose-fulltext-plugin

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q22948F
  • License MIT

Package Exports

  • mongoose-fulltext-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mongoose-fulltext-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.