
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
firebase-query-gator
Advanced tools
This module provides simple API for querying Firebase Realtime Database.
This is a user and developer friendly facade for Firebase Realtime Database standard queries. It does as much as possible to utilize built in firebase queries mechanisms, however due to their limitations some heuristics are used in order to provide simple API for developer.
:warning: Queries Response Time: Althought as much as possible processing is delegated to the firebase backend some operations will require full read of the database. Please also remember that You should add indexes on columns that you plan to use in your queries.
const q = require('firebase-query-gator');
// tell on which database queries should perform
var db = admin.database();
q.init(db);
// from now on one can issue queries
// ...
Object {d: data, m: metadata} is returned for each of the execute() calls. Please see below for detailed specification of each field
Kind | Parameter | Type | Description |
---|---|---|---|
Output | d | array | Result records array |
Output | d[i].v | object | Actual data object returned as i-th record |
Output | d[i].k | object | Actual database key returned for i-th record |
Output | m.s | integer | Size of result records array |
Output | m.n | string | Next page starting element (to be used with start() function ) |
Performs query using the same column/property for filering
var reference = 'course/students'; // from where we make the search
var column = 'nationality';
// create query
var query = q.query(reference);
// narrow only to certain nationality
query = query.where(column, 'Cuban');
// get 10 elements starting from START_ELEMENT
query = query.limit(10).start(START_ELEMNT);
query.execute().then(result=>{
// when resolves then operation was success
// see operations documentation for details
var records = result.d;
var ithRecord = records[i];
var ithValue = ithRecord.v;
var ithVKey = ithRecord.k;
var dataLength = result.m.s;
});
Performs query using the same column/property for sorting
var reference = 'course/students'; // from where we make the search
var column = 'nationality';
// create query
var query = q.query(reference);
// order by nationality
query = query.orderBy(column,query.DIRECTION.DESC);
// get 10 elements starting from START_ELEMENT
query = query.limit(10).start(START_ELEMNT);
query.execute().then(result=>{
// when resolves then operation was success
// see operations documentation for details
var data = result.d;
var dataLength = result.m.s;
});
Performs query using the different columns/properties for sorting and filering
var reference = 'course/students'; // from where we make the search
// create query
var query = q.query(reference);
var columnSort = 'age';
var columnWhere = 'city';
// sort students by age
query = query.orderBy(columnSort,query.DIRECTION.ASC);
// get only students from Warsaw
query = query.where(columnWhere, 'Warsaw');
// get 10 elements
query = query.limit(10).start(START_ELEMNT);
query.execute().then(result=>{
// when resolves then operation was success
// see operations documentation for details
var data = result.d;
var dataLength = result.m.s;
});
Created by maciej.grula@xcft
FAQs
Simple Query Gateway for Firebase
The npm package firebase-query-gator receives a total of 6 weekly downloads. As such, firebase-query-gator popularity was classified as not popular.
We found that firebase-query-gator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.