Socket
Socket
Sign inDemoInstall

parse-query-util

Package Overview
Dependencies
8
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-query-util

Utility functions for large parse queries


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
3.93 MB
Created
Weekly downloads
 

Readme

Source

Parse Query Util

Provides utility functions for large parse queries (i.e. with more than 1000 results).

Installation

npm install --save-dev parse-query-util

Usage

In typescript (javascript is similar):

import { getAllObjects, foldAllObjects } from "parse-query-util";

const query = new Parse.Query("Car")
    .equalTo("owner", "David Beckham");

getAllObjects(query, { useMasterKey: true }).then(cars => {
    // do smth with all cars
});

countAllObjects(query, { useMasterKey: true }).then(numberOfCars => {
    // do smth with total number
})

// this one iterates block-wise over all cars.
// Thus, we do not need to keep all of them in memory.
foldAllObjects(query,
    {},
    (akku, cars) => {
        for (car of cars) {
            const c = car.get("color");
            akku[c] = (akku[c] || 0) + 1;
        }
    },
    { sessionToken: "blah" }).then(allColorsOfMyCars => {
        // do smth with that number
    });

Test

npm test

FAQs

Last updated on 29 May 2017

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