firebase-firestore-enterprise-native-mode

Guides provisioning, security rules, indexes, and SDK usage for Firestore Enterprise Native mode.

Updated Aug 5, 2024
One-click install
npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill firebase-firestore-enterprise-native-mode-nikhilkakarla
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: firebase-firestore-enterprise-native-mode
Source: https://github.com/nikhilkakarla/nikhilkakarla.github.io/tree/main/.agents/skills/firebase-firestore-enterprise-native-mode
Command: npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill firebase-firestore-enterprise-native-mode-nikhilkakarla

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires firebase-tools, and includes references (resource) components.

What problem does it solve? Setting up Firestore Enterprise in Native mode involves many moving parts—database provisioning, security rules, index configuration, and SDK integration—and mistakes in any of these can cause security vulnerabilities or slow queries. This Skill provides structured guidance for each step so developers configure Firestore correctly the first time. ## Core Features & Use Cases - Provisioning & Configuration: Create an Enterprise edition database with the Firebase CLI and set up firebase.json, firestore.rules, and firestore.indexes.json. - Security Rules Generation: Follow a rigorous multi-phase workflow including codebase analysis, validator function patterns, RBAC guidelines, and a devil's advocate attack checklist to produce hardened Firestore Security Rules. - Data Modeling & Indexes: Learn the document/collection data model, collection group queries, and how to define dense, sparse, and unique indexes for query performance. - SDK Usage: Implement reads, writes, transactions, realtime listeners, and pipeline queries with the Web (JavaScript) and Python SDKs. - Use Case: A developer building a new app on Firestore Enterprise can use this Skill to provision the database, generate secure rules that pass attack-vector testing, define composite indexes, and write their first queries. ## Quick Start Help me set up a Firestore Enterprise database in Native mode and generate secure Firestore rules for my app's data model.

Frequently Asked Questions about firebase-firestore-enterprise-native-mode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Firestore Enterprise database in Native mode?▼

Use the Firebase CLI command firebase firestore:databases:create with a database ID, location, --edition="enterprise", and --firestore-data-access="ENABLED". The database ID must not be (default), and you can add --realtime-updates to enable realtime features.

How do I write secure Firestore security rules?▼

Start with default-deny rules, then explicitly allow access using validator functions like isValidUser in both create and update rules. Combine ownership checks with data validation, enforce size limits on strings, protect immutable fields, and test rules against attack vectors like privilege escalation.

Does Firestore Enterprise create indexes automatically?▼

No, Firestore Enterprise edition does not create any indexes by default and performs full collection scans without them. You must define single-field or composite indexes in firestore.indexes.json and deploy them with firebase deploy --only firestore:indexes.

What is the difference between dense and sparse indexes in Firestore?▼

Dense indexes store entries for all documents in a collection, treating missing fields as NULL. Sparse indexes only include documents containing at least one indexed field, reducing storage costs and potentially improving performance.

Can I test Firestore rules and queries locally?▼

Yes, run firebase emulators:start --only firestore to start the local Firestore emulator, typically on port 8080. You can interact with it through the Emulator UI, usually at http://localhost:4000/firestore.

Why does my Firestore compound query fail?▼

Compound queries combining equality on one field with a range or sort on another require a composite index. Check the query support table and define the matching composite index in firestore.indexes.json, then deploy it.