{"id":20741071,"url":"https://github.com/remychantenay/fuego","last_synced_at":"2026-05-20T05:04:24.092Z","repository":{"id":57542460,"uuid":"273709406","full_name":"remychantenay/fuego","owner":"remychantenay","description":"Go library for Google Firestore (Firebase).","archived":false,"fork":false,"pushed_at":"2020-07-04T11:24:25.000Z","size":265,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T01:45:16.777Z","etag":null,"topics":["firebase","firestore","fuego","golang","golang-library","google-cloud","google-firestore"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remychantenay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-20T13:04:33.000Z","updated_at":"2024-04-06T05:13:46.000Z","dependencies_parsed_at":"2022-09-26T18:31:13.315Z","dependency_job_id":null,"html_url":"https://github.com/remychantenay/fuego","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remychantenay%2Ffuego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remychantenay%2Ffuego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remychantenay%2Ffuego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remychantenay%2Ffuego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remychantenay","download_url":"https://codeload.github.com/remychantenay/fuego/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243030805,"owners_count":20224666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firestore","fuego","golang","golang-library","google-cloud","google-firestore"],"created_at":"2024-11-17T06:33:26.080Z","updated_at":"2026-05-20T05:04:24.058Z","avatar_url":"https://github.com/remychantenay.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fuego\n[![Build Status](https://travis-ci.org/remychantenay/fuego.svg?branch=master)](https://travis-ci.org/remychantenay/fuego)\n[![Go Report Card](https://goreportcard.com/badge/github.com/remychantenay/fuego)](https://goreportcard.com/report/github.com/remychantenay/fuego)\n[![codebeat badge](https://codebeat.co/badges/60d273d3-08e6-4f48-9c35-86ab75fc1924)](https://codebeat.co/projects/github-com-remychantenay-fuego-master)\n[![GoDoc](https://godoc.org/github.com/remychantenay/fuego?status.svg)](https://godoc.org/github.com/remychantenay/fuego)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nFuego is a Go client library for Google Firestore. It can be used in App Engine, Cloud Run, Google Cloud Functions and more.\n\nIt does not do anything crazy or magic – the purpose is to reduce the amount of boilerplate by hiding the ceremony that comes with interacting with Firestore.\n\n## Context\nWhile working on a project running on multiple services and serverless functions, I quickly realised that the amount of repetitive and boilerplate code related to Firestore increased exponentially.\n\nI decided to extract this code in a thin layer on top of the Firestore admin client. That's how fuego came to life.\n\n![Fuego](https://raw.githubusercontent.com/remychantenay/fuego/master/art/fuego.jpg)\n\n## Features\n### Documents\n* CRUD operations\n* Retrieving/Updating specific fields only\n* Simple Exists check\n* Write Batches\n\n### Collections\n* Batch processing (update field for all, delete all, etc.)\n* Better flexibility with Arrays and Maps (append/merge or override data)\n\n## Usage\n### Import\n```bash\ngo get github.com/remychantenay/fuego\n```\n\n### Set Up\n```go\nimport \"github.com/remychantenay/fuego\"\n\nfunc main() {\n    fuegoClient := fuego.New(firestoreClient) // firestoreClient needs to be created beforehand.\n    /// Your code here...\n}\n```\n\n### Document\nBear in mind that the examples below are not including how to initialize Firebase and nor create the Firestore client. Check Firebase's documentation for more info.\n\n#### Create\n```go\ntype User struct {\n    FirstName       string              `firestore:\"FirstName\"`\n    LastName        string              `firestore:\"LastName\"`\n    EmailAddress    string              `firestore:\"EmailAddress\"`\n    Address         string              `firestore:\"Address\"`\n    Tokens          map[string]string   `firestore:\"Tokens\"`\n}\n\nfunc main() {\n    user := User{\n        FirstName:      \"John\",\n        LastName:       \"Smith\",\n        EmailAddress:   \"jsmith@email.com\",\n        Address:        []string{\"123 Street\", \"2nd Building\"},\n        Tokens: map[string]string{\n            \"Android\": \"cHzDGYfl5G8vnNCd9xQsbZ:APA...\",\n        },\n    }\n\n    err := fuegoClient.Document(\"users\", \"jsmith\").Create(ctx, user)\n    if err != nil {\n        panic(err)\n    }\n}\n```\n#### Retrieve\n```go\nuser := User{}\nerr := fuegoClient.Document(\"users\", \"jsmith\").Retrieve(ctx, \u0026user)\nif err != nil {\n    panic(err)\n}\n\nfmt.Println(\"LastName: \", user.LastName) // prints: Smith\n```\n\n#### Exists\nYou also may want to only check if a given document exists without providing a struct:\n```go\n// Note: false will be returned if an error occurs as well\nvalue := fuegoClient.Document(\"users\", \"jsmith\").Exists(ctx)\nfmt.Println(\"Exists: \", value)\n```\n\nPlease read the [doc](https://godoc.org/github.com/remychantenay/fuego/document) to see all the documents related operations.\n\n### Collections\nBelow the list of operations available for collections (read the doc for more details):\n| Operation | Description | Additional Information |\n| ------ | ------ | ------ |\n| Retrieve | Retrieve all documents from a collection. | |\n| RetrieveWith | Retrieve documents from a collection (if they meet the criteras). | Uses firestore.Query. |\n| SetForAll | Set a field value for all documents in the collection | Uses Write Batches. |\n| DeleteAll | Removes all documents from a collection. | Uses Write Batches. |\n\nPlease read the [doc](https://godoc.org/github.com/remychantenay/fuego/collection) to see all the collections related operations.\n\n### Write Batches\nWrite Batches allow to group writes together to avoid multiple round trips. They are **NOT** transactions.\nMore info [here](https://firebase.google.com/docs/firestore/manage-data/transactions).\n\n**IMPORTANT**: not all operations are compatible with Write Batches.\n```go\nfuegoClient.StartBatch()\n\n// All **supported** operations executed between here and commit will be batched.\nfuegoClient.Document(\"users\", \"jsmith\").Number(\"Age\").Update(33)\nfuegoClient.Document(\"users\", \"enorton\").String(\"FirstName\").Update(\"Eddy\")\nfuegoClient.Document(\"users\", \"jdoe\").Boolean(\"Premium\").Update(true)\n\nwr, err := fuegoClient.CommitBatch(ctx)\nif err != nil {\n    panic(err)\n}\n```\n\n## Integration Tests\n1. Start the Firestore emulator:\n```bash\nfirebase emulators:start --only firestore\n```\n\n2. Run the tests\n```bash\ngo test . -v\n```\n\n## Dependencies\n* Firebase: `firebase.google.com/go`\n* Firestore: `cloud.google.com/go/firestore`\n\nMore info [here](https://godoc.org/github.com/remychantenay/fuego?imports)\n\n## License\nApache License Version 2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremychantenay%2Ffuego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremychantenay%2Ffuego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremychantenay%2Ffuego/lists"}