2.2.17 • Published 9 months ago

firebase-javascript-interface v2.2.17

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

firebase-javascript-interface@1.2.2

Functions to use firebase cloud firestore and realtime database like CRUD (Create Read Update Delete)

Functions (Now using firebase-admin)

Cloud Firestore

initialize(serviceAccount, databaseURL)

To initialize the database with service account json

Params:

  • serviceAccount {object} service account json
  • databaseURL {string} the url of the realtime database default value = ""

insert(table, value)

To insert new objects to the db

If the collection doesn't exist, it will be created, the Id is generated by firestore

Params:

  • table {string} the collection path ex: "users"
  • value {object} the object to save ex: { user: "sito"}

hardIsert(table, value)

To insert an object to the db with a specific id

If the collection doesn't exist, it will be created

Params:

  • table {string} the collection path ex: "users"
  • value {object} the object to save ex: { user: "sito", id:"myId"}

update(table, key, value)

To update an element Params:

  • table {string} the collection path ex: "users"
  • key {any} the query to find the element ex: "id", "equal", "sito"
  • value {object} the object to save ex: { user: "sito"}

See firestore queries structure

getValue(table, rQuery)

To fetch a single value from db Params:

getTable(table, rQuery, page, count)

To fetch a entire collection Params:

deleteDocuments(table, documents)

To erase elements from a collection Params:

  • table {string} the collection path ex: "users"
  • documents {string[]} array with the list of ids

deleteCollection(table)

To clean a entire collection Params:

  • table {string} the collection path ex: "users"

Realtime database

writeRealtime(path, data)

To set a value Params:

  • path {string} the path to set or update
  • data {object} the data to save

readRealtime(path)

To read a value Params:

  • path {string} the path to read

deleteRealtime(path)

To remove a value Params:

  • path {string} the path to remove
2.2.17

9 months ago

2.1.9

11 months ago

2.1.16

11 months ago

2.1.14

11 months ago

2.1.15

11 months ago

2.1.12

11 months ago

2.1.13

11 months ago

2.1.10

11 months ago

2.1.11

11 months ago

2.1.6

11 months ago

2.1.8

11 months ago

2.1.7

11 months ago

1.2.2

12 months ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

0.10.1

1 year ago

0.11.1

1 year ago

0.12.1

1 year ago

0.11.2

1 year ago

0.10.3

1 year ago

0.13.1

1 year ago

0.11.3

1 year ago

0.14.1

1 year ago

0.14.2

1 year ago

0.9.1

1 year ago

0.6.6

1 year ago

0.6.8

1 year ago

0.8.1

1 year ago

0.6.3

1 year ago

0.7.1

1 year ago

0.6.2

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.1

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago