All Projects → diegohaz → mongoose-keywords

diegohaz / mongoose-keywords

Licence: other
Mongoose plugin that generates a keywords path combining other paths values

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mongoose-keywords

historical
A Mongoose plugin that archives document diffs and manages document history.
Stars: ✭ 33 (+43.48%)
Mutual labels:  mongoose, mongoose-plugin
mongoose-plugin-cache
The Perfect Marriage of MongoDB and Redis
Stars: ✭ 42 (+82.61%)
Mutual labels:  mongoose, mongoose-plugin
mongoose-schema-jsonschema
Mongoose extension that allows to build json schema for mongoose models, schemes and queries
Stars: ✭ 88 (+282.61%)
Mutual labels:  mongoose-schema, mongoose
mongoose-pii
A Mongoose plugin that lets you transparently cipher stored PII and use securely-hashed passwords
Stars: ✭ 43 (+86.96%)
Mutual labels:  mongoose, mongoose-plugin
rake new2
A Python library that enables smooth keyword extraction from any text using the RAKE(Rapid Automatic Keyword Extraction) algorithm.
Stars: ✭ 23 (+0%)
Mutual labels:  keywords
xbn admin node
使用nodejs的express框架搭建的后台管理系统
Stars: ✭ 25 (+8.7%)
Mutual labels:  mongoose
awesome-search-engine-optimization
A curated list of backlink, social signal opportunities, and link building strategies and tactics to help improve search engine results and ranking.
Stars: ✭ 82 (+256.52%)
Mutual labels:  keywords
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (-26.09%)
Mutual labels:  mongoose
Phantom
A mimic website of Pinterest where one can share ideas , socialize and find inspirational ideas
Stars: ✭ 18 (-21.74%)
Mutual labels:  mongoose
search it
Umfangreiche Volltextsuche für REDAXO 5 CMS. Durchsucht Artikel, Medien, Dateien, PDF-Inhalte und Datenbank-Einträge.
Stars: ✭ 60 (+160.87%)
Mutual labels:  keywords
mikaela
Mikaela is a discord music bot that gives users the ability to store their favorite songs, and create playlists on discord.
Stars: ✭ 19 (-17.39%)
Mutual labels:  mongoose
MovieGo
A Website implemented using MERN (MongoDB, ExpressJS, ReactJS and NodeJS) stack, which allows users to sign-in/register and book movie tickets online.
Stars: ✭ 26 (+13.04%)
Mutual labels:  mongoose
Auth-using-Vuejs-express-jwt-nodejs
Login and signup form and authentication using Vue.js, express, mongodb, JWT and bootstrap-vue
Stars: ✭ 17 (-26.09%)
Mutual labels:  mongoose
express-rest-api
🍺 RESTful API sample in Express, Mongoose and ES6.
Stars: ✭ 28 (+21.74%)
Mutual labels:  mongoose
angular-chat
Angular v.9, Node.js, Nest.js v.6, Mongoose, Socket.io, Passport, Angular Universal SSR (in progress...)
Stars: ✭ 35 (+52.17%)
Mutual labels:  mongoose
web full stack application
show full stack technology applications : Scrapy + webservice[restful] + websocket + VueJS + MongoDB
Stars: ✭ 16 (-30.43%)
Mutual labels:  mongoose
typijs
The Angular CMS Framework for building fully-featured SPA sites powered by NodeJS and MongoDB with TypeScript
Stars: ✭ 141 (+513.04%)
Mutual labels:  mongoose
Natours
An awesome tour booking web app written in NodeJS, Express, MongoDB 🗽
Stars: ✭ 94 (+308.7%)
Mutual labels:  mongoose
search-cities
No description or website provided.
Stars: ✭ 11 (-52.17%)
Mutual labels:  mongoose
commerce
🛒 e-commerce-platform
Stars: ✭ 54 (+134.78%)
Mutual labels:  mongoose

mongoose-keywords

JS Standard Style NPM version Build Status Coveralls Status Dependency Status Downloads

Mongoose plugin that recursively generates keywords for documents based on its fields

Install

npm install --save mongoose-keywords

Usage

Single path

var mongoose = require('mongoose');

var ArtistSchema = new mongoose.Schema({
  name: String
});

ArtistSchema.plugin(require('mongoose-keywords'), {paths: ['name']});

var Artist = mongoose.model('Artist', ArtistSchema);

var artist = new Artist({name: "L'arc~en~Ciel"});
console.log(artist.keywords); // ['larc en ciel']

Multiple path

var ArtistSchema = new mongoose.Schema({
  name: String,
  genre: String
});

ArtistSchema.plugin(require('mongoose-keywords'), {paths: ['name', 'genre']});

var Artist = mongoose.model('Artist', ArtistSchema);

var artist = new Artist({name: "L'arc~en~Ciel", genre: 'Jrock'});
console.log(artist.keywords); // ['larc en ciel', 'jrock']

Custom keywords path options

You can still define a keywords path on your schema with predefined options.

var ArtistSchema = new mongoose.Schema({
  name: String,
  keywords: {
    type: [String],
    unique: true // new custom option
  }
});

ArtistSchema.plugin(require('mongoose-keywords'), {paths: ['name']});

Custom keywords field

var ArtistSchema = new mongoose.Schema({
  name: String
});

ArtistSchema.plugin(require('mongoose-keywords'), {
  paths: ['name'],
  field: 'terms'
});

var Artist = mongoose.model('Artist', ArtistSchema);

var artist = new Artist({name: "L'arc~en~Ciel"});
console.log(artist.keywords); // undefined
console.log(artist.terms); // ['larc en ciel']

Custom transform option

By default, mongoose-keywords normalizes the value, but you can provide your own transform function.

var mongoose = require('mongoose');

var ArtistSchema = new mongoose.Schema({
  name: String
});

ArtistSchema.plugin(require('mongoose-keywords'), {
  paths: ['name'],
  transform: function (value) {
    return value + '!!!';
  }
});

var Artist = mongoose.model('Artist', ArtistSchema);

var artist = new Artist({name: "L'arc~en~Ciel"});
console.log(artist.keywords); // ["L'arc~en~Ciel!!!"]

Nested models

var mongoose = require('mongoose');
var mongooseKeywords = require('mongoose-keywords');

var GenreSchema = new mongoose.Schema({
  title: String
});
GenreSchema.plugin(mongooseKeywords, {paths: ['title']});

var ArtistSchema = new mongoose.Schema({
  name: String,
  genre: {
    type: mongoose.Schema.ObjectId,
    ref: 'Genre'
  }
});
ArtistSchema.plugin(mongooseKeywords, {paths: ['name', 'genre']});

var Genre = mongoose.model('Genre', GenreSchema);
var genre = new Genre({title: 'Jrock'});
console.log(genre.keywords); // ['jrock']

var Artist = mongoose.model('Artist', ArtistSchema);
var artist = new Artist({name: "L'arc~en~Ciel", genre: genre});
console.log(artist.keywords); // ['larc en ciel', 'jrock']

License

MIT © Diego Haz

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].