Socket
Socket
Sign inDemoInstall

querent

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    querent

Easily query your js collections.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Querent

Syntax is based of SailsJS Waterline Query Language.

How it works

Run Querent.query(collection, filters) where collection is an array of objects and filters is an object like { surname: 'Simpson' }.

The property's key is the attribute that will be looked for in the object, and the value is the filter for the object to be returned.

Examples

You can add multiple attributes to narrow down your selection. { surname: 'Simpson', age: 10 } will return the elements that match both conditions.

Or you can widen it by allowing for multiple values. { surname: ['Simpson', 'Van Houten'] } will return the elements that match either value.

Another available structure is to negate the predicate by writing. { surname: { '!': 'Wiggum' } } will return the elements whose name is not Wiggum.

You can also filter using nested properties. { grades: { math: { '!': ['A', 'B'] } } } will return the elements whose grade on math not A or B.

Criteria Modifiers

The following modifiers are available to use when querying:

  • < (less than)
  • <= (less than or equal)
  • > (greater than)
  • >= (greater than or equal)
  • ! (not)

Build

You can build from source by running npm run build.

Tests

You can run the test suite by running npm run test.

FAQs

Last updated on 07 Feb 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc