npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

parse-query-builder

v1.0.14

Published

A Node.js module that simplifies the process of building database queries for the Parse platform. It provides an intuitive and flexible way to construct queries with support for various conditions and operators while also supporting all existing methods o

Readme

Parse Query Builder

Parse Query Builder is a Node.js module that simplifies the process of building database queries for the Parse platform. It provides an intuitive and flexible way to construct queries with support for various conditions and operators while also supporting all existing methods of the Parse query.

Installation

To use this package, you can install it via npm:

npm install parse-query-builder

Usage

To get started with the Parse Query Builder, follow these steps:

  1. Import the package into your project.
const { DB } = require('parse-query-builder');
  1. Create a query for a specific Parse class.
const query = DB.table(Parse.Object.extend("YourClassName"));

Use the where method to add conditions to your query. You can specify conditions as arguments or use nested arrays for complex queries.

query.where('fieldName', '=', 'value');
query.where([
['field1', '=', 'value1'],
['field2', '>', 'value2'],
]);

Supported Operators

The Parse Query Builder supports the following operators for building conditions:

= (equalTo)
!= (notEqualTo)
> (greaterThan)
< (lessThan)
>= (greaterThanOrEqual)
<= (lessThanOrEqual)

Example

Here's an example of how to use the Parse Query Builder:

const { DB } = require('parse-query-builder');
const query = DB.table(Parse.Object.extend("YourClassName"));
query.where('fieldName', '=', 'value');
const results = await query.find();
console.log(results);

Other Supported Methods

Query Execution

Get

Executes the query and get record by id.

query.get(id);

Find

Executes the query and retrieves all matching results.

query.find();

First

Executes the query and retrieves the first matching result.

query.first();

Distinct

Queries can find unique values for a specified field.

query.distinct("fieldName")

Select

Select particular fields from the query

query.select("fieldName1", "fieldName2");

Comparison Operators

equalTo

Adds a condition to the query where the specified field is equal to the given value.

query.where("playerName", "Dan Stemkoski");
 // query.where("playerName","=", "Dan Stemkoski");
 // query.equalTo("playerName","Dan Stemkoski");

notEqualTo

Adds a condition to the query where the specified field is not equal to the given value.

query.where("playerName","!=" ,"Dan Stemkoski");
 // query.notEqualTo("playerName","Dan Stemkoski");

greaterThan

Adds a condition to the query where the specified field is greater than the given value.

query.where("wins",">",50);
// query.greaterThan("wins",50);

lessThan

Adds a condition to the query where the specified field is less than the given value.

query.where("wins",50);
// query.lessThan("wins","<",50);

greaterThanOrEqualTo

Adds a condition to the query where the specified field is greater than or equal to the given value.

query.where("wins",">=",50);
// query.greaterThanOrEqualTo("wins",50);

lessThanOrEqualTo

Adds a condition to the query where the specified field is less than or equal to the given value.

query.where("wins","<=",50);
//query.lessThanOrEqualTo("wins",50);

limit

Limiting and Skipping Results

query.limit(10); // limit to at most 10 results

skip

Skips the specified number of results.

query.skip(10); // skip the first 10 results

Additional Query Options

withCount

Includes the count of the total number of results in the query result.

query.withCount(); // to include count

count

get only the count of the total number of results in the query result.

query.count(); 

Sorting Results

ascending

Sorts the results in ascending order based on the specified field.

query.ascending(); // Sorts the results in ascending order by the score field

descending

Sorts the results in descending order based on the specified field.

query.descending(); // Sorts the results in descending order by the score field

Array and Value Checks

containsAll

Adds a condition to the query where the array in the specified field contains all of the specified elements.

// Find objects where the array in arrayKey contains all of the elements 2, 3, and 4.
query.containsAll("arrayKey", [2, 3, 4]);

containedIn

Adds a condition to the query where the specified field contains any of the specified values.

// Finds scores from any of Jonathan, Dario, or Shawn
query.containedIn("playerName",["Jonathan Walsh", "Dario Wunsch", "Shawn Simon"]);

notContainedIn

Adds a condition to the query where the specified field does not contain any of the specified values.

// Finds scores from any of Jonathan, Dario, or Shawn
// Finds scores from anyone who is neither Jonathan, Dario, nor Shawn
query.notContainedIn("playerName",["Jonathan Walsh", "Dario Wunsch", "Shawn Simon"]);

Existence Checks

exists

Adds a condition to the query to find objects where the specified field is set.

// Finds objects that have the score set
query.exists("score");

doesNotExist

Adds a condition to the query to find objects where the specified field is not set.

// Finds objects that don't have the score set
query.doesNotExist("score");

String Matching

startsWith

Adds a condition to the query to find objects where the specified field starts with the given value.

query.startsWith("name", "Big Daddy's");

Other Methods

toJSON

Returns a JSON representation of this query.

query.toJSON();

aggregate

Queries can be made using aggregate, similar to mongodb aggregate method.

const pipeline = [
  { $group: { _id: '$name' } }
];
const query = new Parse.Query("User");
query.aggregate(pipeline)
  .then(function(results) {
    // results contains unique name values
  })
  .catch(function(error) {
    // There was an error.
  });

License

This package is open-source and available under the MIT License.

Issues and Contributions

If you encounter any issues or have suggestions for improvements, please feel free to open an issue on the GitHub repository: Link to GitHub Repository

Contributions and pull requests are welcome!