Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

odata-v4-filter-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

odata-v4-filter-parser

Parse OData $filter syntax into MongoDB syntax in JS

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
60
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

odata-v4-filter-parser is a JS parser which parses OData V4 $filter syntax in URL into MongoDB syntax.

See

  • OData URL Conventions - System Query Option $filter
  • OData ABNF
  • mongoDB Query

Usage

const { parse } = require('odata-v4-filter-parser');

parse("(status eq Enum.Status'ACTIVE' or status eq Enum.Status'DELETED') and id eq 11 and contains(text, 'aa') and (score/overall gt 123) and isof(data, Model.DevcieData)");

results in

{
  "$and": [
    {
      "$or": [
        {
          "status": {
            "$eq": "ACTIVE"
          }
        },
        {
          "status": {
            "$eq": "DELETED"
          }
        }
      ]
    },
    {
      "id": {
        "$eq": 11
      }
    },
    {
      "text": {
        "$regex": ".*aa.*"
      }
    },
    {
      "score.overall": {
        "$gt": 123
      }
    },
    {
      "data": {
        "$type": "Model.DevcieData"
      }
    }
  ]
}

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section.

License

This project is licensed under the MIT license.

FAQs

Package last updated on 06 Aug 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc