{"id":13467813,"url":"https://github.com/sgarciac/fuego","last_synced_at":"2026-03-05T09:01:21.779Z","repository":{"id":36987608,"uuid":"172128103","full_name":"sgarciac/fuego","owner":"sgarciac","description":"Fuego is a command line client for the firestore database (https://firebase.google.com/docs/firestore). ","archived":false,"fork":false,"pushed_at":"2025-11-27T13:19:01.000Z","size":259,"stargazers_count":221,"open_issues_count":6,"forks_count":28,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-12-10T02:36:08.181Z","etag":null,"topics":["cli","client","firebase","firestore","firestore-client","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgarciac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-22T20:08:50.000Z","updated_at":"2025-11-27T13:19:05.000Z","dependencies_parsed_at":"2024-11-15T12:16:46.174Z","dependency_job_id":null,"html_url":"https://github.com/sgarciac/fuego","commit_stats":{"total_commits":188,"total_committers":13,"mean_commits":"14.461538461538462","dds":0.3191489361702128,"last_synced_commit":"5e30613fa5dcf870aaa0980c13ff2aa7c89657c1"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/sgarciac/fuego","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgarciac%2Ffuego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgarciac%2Ffuego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgarciac%2Ffuego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgarciac%2Ffuego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgarciac","download_url":"https://codeload.github.com/sgarciac/fuego/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgarciac%2Ffuego/sbom","scorecard":{"id":814261,"data":{"date":"2025-08-11","repo":{"name":"github.com/sgarciac/fuego","commit":"c709dfa5f5ec1634c495fc8cc9f183fd7d77d15d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 6/28 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/dev.workflow.yml:1","Warn: no topLevel permission defined: .github/workflows/master.workflow.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dev.workflow.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/dev.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dev.workflow.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/dev.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dev.workflow.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/dev.workflow.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dev.workflow.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/dev.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dev.workflow.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/dev.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.workflow.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/sgarciac/fuego/master.workflow.yml/develop?enable=pin","Info:   0 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/master.workflow.yml:53"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.35.0 not signed: https://api.github.com/repos/sgarciac/fuego/releases/175096336","Warn: release artifact 0.34.0 not signed: https://api.github.com/repos/sgarciac/fuego/releases/117998366","Warn: release artifact 0.33.0 not signed: https://api.github.com/repos/sgarciac/fuego/releases/79665978","Warn: release artifact 0.32.0 not signed: https://api.github.com/repos/sgarciac/fuego/releases/69806961","Warn: release artifact 0.31.1 not signed: https://api.github.com/repos/sgarciac/fuego/releases/54819111","Warn: release artifact 0.35.0 does not have provenance: https://api.github.com/repos/sgarciac/fuego/releases/175096336","Warn: release artifact 0.34.0 does not have provenance: https://api.github.com/repos/sgarciac/fuego/releases/117998366","Warn: release artifact 0.33.0 does not have provenance: https://api.github.com/repos/sgarciac/fuego/releases/79665978","Warn: release artifact 0.32.0 does not have provenance: https://api.github.com/repos/sgarciac/fuego/releases/69806961","Warn: release artifact 0.31.1 does not have provenance: https://api.github.com/repos/sgarciac/fuego/releases/54819111"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T13:52:03.467Z","repository_id":36987608,"created_at":"2025-08-23T13:52:03.468Z","updated_at":"2025-08-23T13:52:03.468Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","client","firebase","firestore","firestore-client","hacktoberfest"],"created_at":"2024-07-31T15:01:00.889Z","updated_at":"2026-03-05T09:01:21.730Z","avatar_url":"https://github.com/sgarciac.png","language":"Go","funding_links":[],"categories":["Go","CLI \u0026 에디터"],"sub_categories":["iOS"],"readme":" *PLEASE READ THE [STABLE VERSION DOCUMENTATION](https://sgarciac.github.io/fuego/) IF YOU ONLY WANT TO USE FUEGO*\n\n# fuego\n\n[![Mentioned in Awesome Firebase](https://awesome.re/mentioned-badge.svg)](https://github.com/jthegedus/awesome-firebase)\n\nA command-line firestore client.\n\n## Installation\n\n### Precompiled binaries\n\nDownload one of the precompiled binaries from the [latest\nrelease](https://github.com/sgarciac/fuego/releases). (builds available for\nwindows, Linux, Macintosh/Darwin)\n\n### Snap\n\nLinux users can install fuego via snap. However, you'll probably need to install it using --devmode for it to be able to access\nto your GOOGLE_APPLICATION_CREDENTIALS file.\n\n```sh\nsnap install fuego --devmode\n```\n\n### Building it locally\n\nIf you are comfortable building programs, you can build fuego yourself using [go](https://golang.org/dl/):\n\n```sh\ngit clone https://github.com/sgarciac/fuego.git\ncd fuego\ngo build . # and 'go install .' if you want\n./fuego --help\n```\n\n## Usage\n\n### Authentication\n\nYou'll need a Service Account key file to be able to access your project's\nfirestore database. To create a service account private key file, if you don't\nhave one, go to your firebase project console, then _Project settings_ and then\nclick on the _Service accounts_ tab and generate a new private key.\n\nOnce you have your service account key file, fuego will be able to find it using\none of the following options:\n\n1. Use the ```--credentials``` flag every time you execute fuego, i.e.:\n\n```sh\nfuego --credentials ./my-account-service-private-key.json get mycollection mydocumentid\n```\n\nor\n\n2. Via the GOOGLE_APPLICATION_CREDENTIALS environment variable:\n\n```sh\nexport GOOGLE_APPLICATION_CREDENTIALS=./my-account-service-private-key.json\nfuego get mycollection mydocumentid\n```\n\n### Project\n\nFirestore databases belong to projects. The google application credentials file\nusually define the project that firestore will work on. You can however, if\nnecessary, define the project using the global option ```--projectid```.\n\n### Firestore emulator usage\n\nIf you need to use fuego with the firestore emulator instead of a real firestore\ndatabase, set the FIRESTORE_EMULATOR_HOST environment variable to something\nappropriate (usually, localhost:8080). **NOTE**: When using the emulator, you\nare likely not using a GOOGLE_APPLICATION_CREDENTIALS file. Therefore, no\nproject will be defined. **You can set a project** using the global option\n```--projectid```, otherwise it will use 'default' as the project identifier.\n\n### List collections\n\n```sh\nfuego collections\n```\n\nWill return the list of project's collections.\n\n### Writing and reading data\n\nYou can add new documents, using JSON:\n\n```sh\nfuego add people '{\"name\": \"sergio\", \"age\": 41}'\n# Rv7ZfnLQWprdXuulqMdf \u003c- fuego prints the ID of the newly created document\n```\n\nOf fetch them, using the ID:\n\n```sh\nfuego get people Rv7ZfnLQWprdXuulqMdf\n# {\n#     \"CreateTime\": \"2021-08-22T23:53:31.439821Z\",\n#     \"Data\": {\n#         \"age\": 41,\n#         \"name\": \"sergio\"\n#     },\n#     \"ID\": \"Rv7ZfnLQWprdXuulqMdf\",\n#     \"ReadTime\": \"2021-08-23T01:57:12.30626Z\",\n#     \"UpdateTime\": \"2021-08-22T23:53:31.439821Z\"\n# }\n\n\n```\n\nOr fetch them using multiple ids:\n```sh\nfuego  getall people WkVlcPgEJIXzdyQS6H5d f2TbJA5DIhBfXwKrMbHP\n[\n# {\n#     \"CreateTime\": \"2021-08-22T23:53:31.439821Z\",\n#     \"Data\": {\n#         \"age\": 41,\n#         \"name\": \"sergio\"\n#     },\n#     \"ID\": \"WkVlcPgEJIXzdyQS6H5d\",\n#     \"ReadTime\": \"2021-08-23T01:57:12.30626Z\",\n#     \"UpdateTime\": \"2021-08-22T23:53:31.439821Z\"\n# },\n# {\n#     \"CreateTime\": \"2021-08-22T23:53:31.439821Z\",\n#     \"Data\": {\n#         \"age\": 23,\n#         \"name\": \"rohan\"\n#     },\n#     \"ID\": \"f2TbJA5DIhBfXwKrMbHP\",\n#     \"ReadTime\": \"2021-08-23T01:57:12.30626Z\",\n#     \"UpdateTime\": \"2021-08-22T23:53:31.439821Z\"\n# }\n# ]\n```\n\nYou can also replace an existing document:\n\n```\nfuego set people/Rv7ZfnLQWprdXuulqMdf '{\"name\": \"sergio\", \"age\": 42}' # It's my birthday!\n```\n\n*Note*: we can either use the arguments ```collection-path document-id\njson-data``` or ```document-path json-data```. This is also the case for the\ndelete and the get commands.\n\nIn both ```add``` and ```set``` commands, the document argument can be either a\nJSON string (if it starts with the character ```{```) or a path to a JSON file, i.e.:\n\n```sh\nfuego add animals ./dog.json\n```\n\nTo delete a document:\n\n```sh\nfuego delete people/Rv7ZfnLQWprdXuulqMdf\n```\n\nnote: this won't delete any subcollections under the document.\n\nTo delete a document including subcollections, use the ```--recursive, -r``` flag.\nUsing the ```-r``` flag will also delete missing documents. A missing document is a \ndocument that does not exist but has sub-documents.\n```sh\nfuego delete -r people/Rv7ZfnLQWprdXuulqMdf\n```\n\nIt's also possible to delete multiple documents without transaction\n```sh\nfuego delete people Rv7ZfnLQWprdXuulqMdf,Rv7ZfnLQWprdXuulqMde\n```\n\nDeleting a specific field of a document, the ```--field, -f``` flag can be used.\n```sh\nfuego delete people/Rv7ZfnLQWprdXuulqMdf -f age\n```\nThis command will delete the age field from the given doument path.\n\n\nTo update an existing document:\n\n```sh\nfuego set --merge people Rv7ZfnLQWprdXuulqMdf '{\"location\": \"unknown\"}'\n# Rv7ZfnLQWprdXuulqMdf \u003c- fuego prints the ID of the updated document\nfuego get people Rv7ZfnLQWprdXuulqMdf\n\n# {\n#     \"CreateTime\": \"2021-08-22T23:53:31.439821Z\",\n#     \"Data\": {\n#         \"age\": 41,\n#         \"name\": \"sergio\",\n#         \"location\": \"unknown\"\n#     },\n#     \"ID\": \"Rv7ZfnLQWprdXuulqMdf\",\n#     \"ReadTime\": \"2021-08-23T01:57:12.30626Z\",\n#     \"UpdateTime\": \"2021-08-22T23:53:31.439821Z\"\n# }\n\n```\n\n### Advanced types\n\nOur examples here use only basic JSON to represent firestore documents. However,\nJSON types are not enough to represent some of firestore types, for instance\ngeo-locations or timestamps.\n\nPlease read the [TYPES](TYPES.md) documentation if you want to know how fuego\nmaps JSON documents to firestore documents, and how to express the more advanced\ntype system using our 'extended JSON'.\n\n### Subcollections\n\nYou can work on sub-collections using the full path with \"/\"s as separators. For\nexample:\n\n```sh\nfuego query countries/france/cities\n```\n\n### Queries\n\nLet's explain queries by example. First, we'll create a collection of physics\nNobel laureates,\n\n```sh\nfuego add nobel '{\"name\": \"Arthur Ashkin\", \"year\": 2018, \"birthplace\": {\"country\":\"USA\", \"city\": \"New York\"}}'\nfuego add nobel '{\"name\": \"Gerard Mourou\", \"year\": 2018, \"birthplace\": {\"country\":\"FRA\", \"city\": \"Albertville\"}}'\nfuego add nobel '{\"name\": \"Donna Strickland\", \"year\": 2018, \"birthplace\": {\"country\":\"CAN\", \"city\": \"Guelph\"}}'\nfuego add nobel '{\"name\": \"Rainer Weiss\", \"year\": 2017, \"birthplace\": {\"country\":\"DEU\", \"city\": \"Berlin\"}}'\nfuego add nobel '{\"name\": \"Kip Thorne\", \"year\": 2017, \"birthplace\": {\"country\":\"USA\", \"city\": \"Logan\"}}'\nfuego add nobel '{\"name\": \"Barry Barish\", \"year\": 2017, \"birthplace\": {\"country\":\"USA\", \"city\": \"Omaha\"}}'\nfuego add nobel '{\"name\": \"David Thouless\", \"year\": 2016, \"birthplace\": {\"country\":\"GBR\", \"city\": \"Bearsden\"}}'\n```\n\nWe can query the full collection:\n\n```sh\nfuego query nobel\n# Prints all our nobel laureates like this:\n# [\n#    {\n#        \"CreateTime\": \"2019-02-26T02:39:45.293936Z\",\n#        \"Data\": {\n#            \"birthplace\": {\n#                \"city\": \"Bearsden\",\n#                \"country\": \"GBR\"\n#            },\n#            \"name\": \"David Thouless\",\n#            \"year\": 2016\n#        },\n#        \"ID\": \"BJseSVoBatOOt8gcwZWx\",\n#        \"ReadTime\": \"2019-02-26T02:55:19.419627Z\",\n#        \"UpdateTime\": \"2019-02-26T02:39:45.293936Z\"\n#    },\n# .... etc\n```\n\nWhich will fetch and display the documents in the collection, unfiltered. By default, fuego will fetch only 100 documents. You can change the limit using the ```--limit``` flag.\n\nYou can also order the results using the ```--orderby``` and ```--orderdir```\nflags. For example, to sort our Nobel laureates by country of origin, in\nascending order:\n\n```sh\nfuego query --orderby birthplace.country --orderdir ASC nobel\n```\n\nYou can add filters, using the firestore supported operators :\n\n```\n\u003e, \u003c, \u003e=, \u003c=, ==, !=, \u003cin\u003e, \u003cnot-in\u003e, \u003carray-contains\u003e or \u003carray-contains-any\u003e\n```\n\nYou can combine several filters in a\nsingle query. For example, to get the 2018 Nobel laureates from the USA:\n\n```sh\nfuego query nobel 'birthplace.country == \"USA\"' 'year == 2018'\n```\n\nwhich will print:\n\n```json\n[\n    {\n        \"CreateTime\": \"2019-02-26T02:14:02.692077Z\",\n        \"Data\": {\n            \"birthplace\": {\n                \"city\": \"New York\",\n                \"country\": \"USA\"\n            },\n            \"name\": \"Arthur Ashkin\",\n            \"year\": 2018\n        },\n        \"ID\": \"glHCUu7EZ3gkuDaVlXqv\",\n        \"ReadTime\": \"2019-02-26T03:00:15.576398Z\",\n        \"UpdateTime\": \"2019-02-26T02:59:55.889775Z\"\n    }\n]\n\n```\n\n\nOr USA and Germany.\n\n```sh\nfuego query nobel 'birthplace.country \u003cin\u003e [\"USA\",\"DEU\"]' 'year == 2018'\n```\n\n\n\nLet's say we want to find the least recent Nobel from the USA, we can write the following query:\n\n```sh\nfuego query --limit 1 --orderby year --orderdir ASC nobel \"birthplace.country == 'USA'\"\n```\n\noops, we get the following error from the server, because our query needs an index to work:\n\n```\nrpc error: code = FailedPrecondition desc = The query requires an index.\nYou can create it here:\nhttps://console.firebase.google.com/project/myproject/database/firestore/indexes?create_index=EgVub2JlbBoWChJiaXJ0aH....\n```\n\nAfter creating the index, we re-run the query and now we obtain:\n\n```json\n[\n    {\n        \"CreateTime\": \"2019-02-26T02:39:44.458647Z\",\n        \"Data\": {\n            \"birthplace\": {\n                \"city\": \"Omaha\",\n                \"country\": \"USA\"\n            },\n            \"name\": \"Barry Barish\",\n            \"year\": 2017\n        },\n        \"ID\": \"ainH3nkOA2xusEBON2An\",\n        \"ReadTime\": \"2019-02-26T03:12:07.156643Z\",\n        \"UpdateTime\": \"2019-02-26T02:39:44.458647Z\"\n    }\n]\n```\n#### Value and field path types in filters\n\nI our previous examples, all the segments of the path part of a filter contained\nalphanumeric or the _ character and did not start with a number. When this\nconditions are met, they can be written unquoted. Otherwise, they need to be\nunquoted.\n\n```sh\nfuego query weirdcollection 'really.\"    \".strage.\" but valid \".fieldname == \"even blank keys are valid\"'\n```\n\nAs for values, numeric, string, boolean (true or false) and timestamp values are supported in\nfilters. Examples of queries:\n\n\"age \u003e= 34\", \"name == 'paul'\", \"married == true\", and \"birthday == 1977-06-28T04:00:00Z\"\n\nNote that timestamps values should use the RFC3339 format and should not be\nquoted. Boolean values are represented by the unquoted *true* and *false*\nstrings.\n\nArrays values should be expressed as in the following example. Notice that items\nare separated by space:\n\n```sh\nfuego query cities 'name \u003cin\u003e [\"bogota\" \"cali\" \"medellin\"]'\n```\n\n\n#### Selecting specific fields\n\nUse the --select flag to explicitely ask for the specific fields you want to be\nretrieved (you can define many using several --select)\n\n```sh\nfuego query --select name --select year --limit 1 --orderby year --orderdir ASC nobel \"birthplace.country == 'USA'\"\n```\n\n#### Pagination of query results\nIf necessary, you can use the firestore pagination parameters to manually page through results.\nCombining --limit with the flags --startat, --startafter, --endat, and --endbefore,\nwhich all accept the ID of a document.\n\n#### Group queries\n\nYou can make [group\nqueries](https://firebase.google.com/docs/firestore/query-data/queries) to query all the subcollections sharing a common ID by using\nthe -g flag.\n\n```sh\nfuego add cities/france/landmarks '{\"name\": \"The Eiffel Tower\"}'\nfuego add cities/sf/landmarks '{\"name\": \"Golden Gate Bridge\"}'\nfuego query -g landmarks\n```\n\n### Copying\nBasic usage\n```sh\nfuego copy source target\n```\n#### Copying collection\nWe can copy a collection and its sub collections\n```sh\nfuego copy countries/france/cities countries/germany/cities\n```\nBy default, existing documents in target collection will be skipped. If you want to overwrite the existing document, just use --overwrite\n```sh\nfuego copy countries/france/cities countries/germany/cities --overwrite\n```\nAlso, using flag --merge let us can use merging mode to overwrite the existing documents\n```sh\nfuego copy countries/france/cities countries/germany/cities --overwrite --merge\n```\n\n#### Copying document\nWe can copy a document and its sub collections.\n```sh\nfuego copy countries/france countries/germany\n```\nParameters --merge and --overwrite can also be used to specify the copying behavior.\n\n#### Cross projects copying\nWe may have firestore in different Google projects. We can specify the source project credential by using `--src-credentials` (or `-sc`) and target project credential by using `--dest-credentials` (or `-dc`).\nThe default value of the `--src-credentials` and `--dest-credentials` is our current working project.\n```sh\nfuego copy countries/france countries/germany --src-credentials ./project-a-key.json --dest-credentials ./project-b-key.json --overwrite --merge\nfuego copy countries/france/cities countries/germany/cities --src-credentials ./project-a-key.json --dest-credentials ./project-b-key.json\n```\nWe may also have a credential that has access to different projects. We can specify the source project ID by `--src-projectid` (or `-sp`) and target project ID by using `--dest-projectid` (or `-dp`).\nThe default value of the `--src-prjectid` and `--dest-prjectid` is the ID of our current working project.\n```sh\nfuego copy countries/france countries/germany --src-projectid project-a --dest-projectid project-b --overwrite --merge\nfuego copy countries/france/cities countries/germany/cities --dest-projectid prject-c\n```\n\n## Contributing\n\nSee the [HACKING](HACKING.md) file for some guidance on how to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgarciac%2Ffuego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgarciac%2Ffuego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgarciac%2Ffuego/lists"}