baucis-decorator-insensitive
Allows an insensitive
query parameter and acts like a very basic auto-complete.
Install
npm install baucis-decorators baucis-decorator-insensitive --save
Usage
Just add the decorator and then suppose you have some users named "John", "joe", and "JONNY". You'd be able to GET all three of those users via /api/users?insensitive[name]=jo
.
Example
controllers/Resource.js
var baucis = ;var mongoose = ;var Schema = mongooseSchema;var ObjectId = SchemaTypesObjectId; var ResourceProps = {}; ResourcePropsname = type: String; var ResourceSchema = ResourceProps;var ResourceModel = mongoose;var ResourceController = baucis; var decorators = ;decoratorsadd; /** * Expose controller. */moduleexports = ResourceController;