Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Initialize Cloud Firestore through Firebase
  2. var db = firebase.firestore();
  3.  
  4. // Disable deprecated features
  5. db.settings({
  6.   timestampsInSnapshots: true
  7. });
  8. //collector that sends some data toe the firestore
  9. db.collection("users").add({
  10.     first: "Ada",
  11.     last: "Lovelace",
  12.     born: 1815
  13. })
  14. .then(function(docRef) {
  15.     console.log("Document written with ID: ", docRef.id);
  16. })
  17. .catch(function(error) {
  18.     console.error("Error adding document: ", error);
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement