{"repo":"loris/api-query-params","free":true,"listed":false,"github":"https://github.com/loris/api-query-params","clone":"git clone https://github.com/loris/api-query-params.git","description":"Convert URL query parameters to MongoDB queries","language":"JavaScript","stars":179,"topics":["mongodb-query","mongodb","mongoose","query-builder","url","api"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"api-query-params [![NPM version][npm-image]][npm-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url] [![Downloads][download-badge]][npm-url] Convert query parameters from API urls to MongoDB queries (advanced querying, filtering, sorting, …) Features - Powerful . Supports most of MongoDB operators ( $in , $regexp , …) and features (nested objects, projection, type casting, …) - Custom . Allows customization of keys (ie, fields vs select ) and options - Agnostic. Works with any web frameworks (Express, Koa, …) and/or MongoDB libraries (mongoose, mongoskin, …) - Simple. 200 LOCs, dependency-free ES6 code - Fully tested. 100% code coverage Install Usage API aqp(queryString, [opts]) Converts queryString into a MongoDB query object Arguments - queryString : query string part of the requested API URL (ie, firstName=John&limit=10 ). Works with already parsed object too (ie, {status: 'success'} ) [required] - opts : object for advanced options (See below) [optional] Returns The resulting object contains the following properties: - filter which contains the query criteria - projection which contains the query projection - sort , skip , limit which contains the cursor modifiers - population which contains the query population (mongoose feature only) Example Example with Express and mongoose That's it. Your /users endpoint can now query, filter, sort your User mongoose model and more. Supported features Filtering operators MongoD","default_branch":null,"files":null,"tree":[],"storefront":"/r/loris","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/loris/api-query-params/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}