You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mongoose-by-hash

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-by-hash

A plugin to use hashes as the main method

1.1.3
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

mongoose-by-hash

A plugin to use hashes as the main method

TODO: Pending add more checks, test and documentation

Installation

The best way to install it is using npm

npm install mongoose-by-hash --save

Loading

var FindByHash = require('mongoose-by-hash');

Initialization and Usage

Basic usage (you can see how works better with test:


/* Setup */
mongoose.set('debug', true);
mongoose.connect('mongodb://localhost/mongoose-by-hash');

Resource = new mongoose.Schema({
    title: {type: String}
},{timestamps:true});

Resource.plugin(FindByHash, {name: 'sweetThing', 'default': "shortid"});
mongoose.model('Resource', Resource);


Resource = new mongoose.Schema({
    title: {type: String}
},{timestamps:true});

Resource.plugin(FindByHash, {'default': "uuid"});
mongoose.model('ResourceUUID', Resource);



Resource = new mongoose.Schema({
    title: {type: String}
},{timestamps:true});

Resource.plugin(FindByHash, {'default': function(){return hashExample}});
mongoose.model('ResourceFunction', Resource);


Support

This plugin is proudly supported by Kubide hi@kubide.es

Keywords

mongoose

FAQs

Package last updated on 11 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts