Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
Hannah Wolfe edited this page Jul 17, 2018 · 7 revisions

This page describes the NQL Language, originally described in TryGhost/Ghost#5463.

Table of Contents:


Summary

The goal of the NQL language is to be a powerful, simple-to-contruct, string-based query format that represents any valid MongoDB query object and works as a valid filter strategy in the JSONAPI Spec.

The language is designed to work in many contexts:

  • HTTP / URI
  • Method Call (ES5/ES6)
  • Handlebars helper

Differences from GQL

The main difference between GQL and NQL is that GQL was a combined library that used its own made-up JSON format as a middle ground between the GQL string format and converting to knex.

NQL-Lang is just the NQL language parser, which converts to MongoDB's Query JSON format.

Syntax Differences

  1. NQL supports single-char literals
  2. NQL does NOT support colons at the start of literals

Examples

Here is a separate Gist outlining some example queries in HTTP, method call & get helper form: https://gist.github.com/ErisDS/f516a859355d515aa6ad.

Clone this wiki locally