Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeibberson/mongoose-partial-search
Regex-powered partial search plugin
https://github.com/mikeibberson/mongoose-partial-search
mongoose mongoose-plugin
Last synced: about 1 month ago
JSON representation
Regex-powered partial search plugin
- Host: GitHub
- URL: https://github.com/mikeibberson/mongoose-partial-search
- Owner: MikeIbberson
- License: mit
- Created: 2019-11-27T21:17:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:49:57.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T12:05:53.268Z (about 1 month ago)
- Topics: mongoose, mongoose-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mongoose-partial-search
- Size: 1.4 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🔎 Mongoose partial search plugin
This packages adds a
searchBuilder
static method to the Mongoose model that returns a case-insensitive, regex-powered query to drop into your find functions.``` Javascript
const plugin = require('mongoose-partial-search');
const mongoose = require('mongoose');const Schema = new mongoose.Schema({
name: {
type: String,
searchable: true,
}
});Schema.plugin(plugin);
const Model = mongoose.model('foo', Schema);
const query = Model.searchBuilder('bar');// then, use the query however you like.
```