Firestore write

  title: "new one",
  description: "new description"
.then(function(docRef) {
  console.log("Document written with ID: ",;
.catch(function(error) {
  console.error("Error adding document: ", error);


There current is roughly 40,000 limit to indexing for Firestore.

Large string fields If you have a string field that often holds long string values that you don’t use for querying, you can cut storage costs by exempting the field from indexing.

Remove indexes

To delete an index:

  1. Go to the Database section of the Firebase console.

  2. Click the Indexes tab.

  3. Hover over the index you want to delete and select Delete from the context menu.

  4. Confirm that you want to delete it by clicking Delete from the alert.

It doesn't mention anywhere how to do this programmatically... :(

Server Timestamp

You need access to FieldValue, which is available from firebase.firestore.FieldValue.serverTimestamp()

This can also be used client side

Last updated