Socket
Socket
Sign inDemoInstall

@sensenet/query

Package Overview
Dependencies
3
Maintainers
6
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sensenet/query

Client side content query builder package for sensenet


Version published
Weekly downloads
2
decreased by-80%
Maintainers
6
Install size
590 kB
Created
Weekly downloads
 

Readme

Source

@sensenet/query

NPM version NPM downloads License: GPL v2

Install

# Yarn
yarn add @sensenet/query

# NPM
npm install @sensenet/query

Usage

The package allows you to create strongly typed content queries that will be evaluated into sensenet queries

Usage example:

const query = new Query(
  (q) =>
    q
      .typeIs<Task>('Task') // adds '+TypeIs:Task' and Typescript type cast
      .and.equals('DisplayName', 'Unicorn') // adds +Title:Unicorn
      .and.between('ModificationDate', '2017-01-01T00:00:00', '2017-02-01T00:00:00')
      .or.query(
        (sub) =>
          sub // Grouping
            .notEquals('Approvable', true)
            .and.notEquals('Description', '*alma*'), // Contains with wildcards
      )
      .sort('DisplayName')
      .top(5) // adds .TOP:5
      .skip(10), // adds .SKIP:10
)

console.log(query.toString())
// "TypeIs:Task AND DisplayName:'Unicorn' AND ModificationDate:{'2017-01-01T00\\:00\\:00' TO '2017-02-01T00\\:00\\:00'} OR (NOT(Approvable:'true') AND NOT(Description:'*alma*')) .SORT:DisplayName .TOP:5 .SKIP:10"

Keywords

FAQs

Last updated on 03 Apr 2024

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