Skip to content

UFO-Studios/node-firestore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Firestore

Using Firestore made easy!

Functions

const firestore = require("node-firestore");

// Initialize the DB, very important.
await firestore.initialize();

// Add data to the DB.

const success = firestore.addData("collectionName", "documentName", { your: "data" });

// checkout allowed data 

// if wasnt successful
if (!success) {
  console.error(); // "There was an error please try again later."
}

// Read data from the DB.

const data = firestore.getData("collectionName", "documentName");

if (!data) {
  console.error(); // "Data not found"
} else {
  console.log(data); //=> { your: "data" }
}

// Delete data on DB.

const success = firestore.deleteData("collectionName", "documentName");

if (!success) {
  console.error(); // "Couldn't delete data."
}

// Delete collection on DB

const success = firestore.deleteCollection("collectionName", 10);

if (!success) {
  console.error(); // "Couldn't delete collection."
}

About

A simple API wrapper for firestore

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%