Giter Club home page Giter Club logo

fuego's People

Contributors

anishkny avatar arhuaco avatar clarityflowers avatar happytomatoe avatar kogura1995 avatar leitc avatar mopsgeschwindigkeit avatar pas256 avatar sgarciac avatar trhura avatar tripflex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuego's Issues

Throws invalid token error for $

While a dollar sign is valid within a property name, fuego doesn't appear to allow it:

fuego query myCollection '$archived == true'                                                                                                                                                      
Error parsing query '$template' <source>:1:1: invalid token '$'

I believe this line is the one that needs to be changed to allow it.

In Firestore, property names can have any valid UTF-8 character, though I have found issues when using periods, since that's also used as the field separator. But all other characters should be valid here.

`snap install fuego` not installed (?) correctly

I'm using Ubuntu 22.10.

I've been go install github.com/sgarciac/fuego@latest successfully but noticed there's a Snap.

rm $(which fuego)
sudo snap install fuego

And:

ls -l /snap/fuego
total 0
drwxr-xr-x 4 root root 38 Jun 19 18:44 16
lrwxrwxrwx 1 root root  2 Oct 11 09:58 current -> 16

ls -l /snap/fuego/16
total 0
drwxr-xr-x 2 root root 28 Jun 19 18:44 bin
drwxr-xr-x 2 root root 32 Jun 19 18:44 meta

ls -l /snap/fuego/16/bin
total 17113
-rwxr-xr-x 1 root root 17523378 Jun 19 18:44 fuego

But:

  • nowhich fuego
  • no /snap/bin/fuego ln
  • no ${HOME}/snap/fuego folder

Does `getall` work?

When trying to issue a "getall" command, no matter what I try I get "No help topic for 'ga'"

~/Downloads/fuego_0.20.0_MacOS_64-bit
➜ fuego -c ~/Documents/creds.json ga
No help topic for 'ga'

Support for arrays in an "input" file?

Hello and thanks for a great project.
Maybe I missed a beat, but is there a way to import a file containing an array of objects? In your documentation, I would like to be able to provide a dogS.json... ^_^
I tried a few ways but none worked....

How to pass types?

If I pass though something like "points":0, in my JSON, my Model factory parsing it, thinks that it is a double, not an int. This doesn't happen when I add it via the application which is typed.

Fuego version 0.31.1

Is it possible to query for subcollections?

Thanks a lot for a great tool!

But (unfortunately) I made a collection with documents in, which then have collections again. And those collections has documents...

Is is possible to query for those collection-document-collection-documents?

Thanks again!

Cheers!

Best regards,

Jens Schwarzer :)

Auto generated IDs are 32 bytes instead of 24

Took me a while to figure out why it was doing this, but turns out it was due to the go lib this project relies on:
googleapis/google-cloud-go#1715

This was a huge issue for me generating IDs with crazy long values, seem all the latest pre-built versions of fuego are impacted by this

ps -- by the way thank you for adding delete handling!

Unsupported value: NaN

Error happening when exporting a NaN value. Not sure how to map that to a json file but, I think that null should be fine.

Thanks!

Apologies for saying "Thanks!" via an issue but I was unable to find other contact information.

This is a very helpful tool, thank you! I continue to be surprised|disappointed that Google hasn't added this functionality either to the Firebase or Cloud SDK CLIs.

I wrote a CLI for one of my databases but Fuego is more generic and useful.

I'm going to incorporate it into my application deployment script.

Being able to populate a Firestore database is clearly a common and useful facility for e.g. automated deployment|testing.

Thank you!

Please consider adding contact details ;-)

Using local firestore emulator for tests

Hi,
i played around with the new firestore emulator and added a branch which switches fuegos test suite over to a local emulator.

At the moment one test is failing with the local emulator. I will raise this with google. Besides this the emulator looks to be much faster and does not need connectivity or a gcp project.

Regards,
Carsten

Offline Support

Hey, is there anyway to enable offline support for this? Would love to see this feature if it is not already available.

"Fuego set" creates repeated document ids

Hi chamo.
I wanted to emulate a bulk update with fuego, so I wrote a set command inside a loop. This is my code:

for i in $(jq -r ".[] | .ID" requests.json)
do
fuego set --merge solicitudes $i '{"version": 2}'
done

I'm using jq and bash to run this script. When I use echo $i, it shows all my ids correctly, but when I use the fuego command, it keeps creating new documents with duplicate ids. I tried leaving just one element in the array and it works as expected!
I would like to know what is going on and how to fix it.

Thanks in advance

Unexpected behavior when using with firestore emulator

When I used the Fuego cli to add a new collection or document these changes don't reflect in firestore emulator UI and vice versa.

Step to reproduce:
1- set FIRESTORE_EMULATOR_HOST to localhost:8080
2- run the command: fuego add [collectionName] .collection.json
3- check if collection was added: fuego query [collectionName]
4- go to http://localhost:4000/firestore

Bug:
The changes didn't appear in the emulator UI.
Expected:
All collections added in emulator UI or Fuego CLI should appear in both interfaces.

Screen Capture_select-area_20210106113132

Feature Request: brew package

I find fuego really helpful, particularly during testing or for getting an emulator sample db up and running quickly, so thanks for writing it!

I personally don't like snap so is there any possiblity of packaging fuego for brew?

I haven't personally packaged anything for brew before, or I'd just send a PR, but if this is something you'd merge and it isn't something you can knock out in 5 minutes, I'd be happy to learn how!

Add support for adding a collection from json string

Happy to have found your tool here. I'm working to migrate one db to another, I used the query command to save an array of json objects and this works fine.

$ fuego query someCollection > someCollection.array.txt

Where someCollection.array.txt looks like the following,

[
 { "property": value },
 { "property": value },
 { "property": value }
...
]

Next, I'd like to use the output above to add to a collection e.g.
$ fuego add collection ./someCollection.array.txt

Currently it doesn't seem that this is possible!

Alternatively query might output json
$ fuego query someCollection > someCollection.json

...
{ someCollection:
[
{ "property": value },
{ "property": value },
{ "property": value }
]
}
...

followed by this,
$ fuego add someCollection.json

Dropping a property in a document

I'm trying to figure out a way to drop individual properties from documents.

While this would make a property null

fuego set --merge collection/document '{"property.path": null}'

is there a way to drop a one altogether?

Something like

fuego set --merge collection/document '{"property.path": <drop>}'

or

fuego delete collection/document/property.path

Error handling

We really need more graceful error handling, messages are hideous ;-)

`go get` failed

This happened when I tried to install it.

→ go get github.com/sgarciac/fuego

# cloud.google.com/go/firestore
../../go/src/cloud.google.com/go/firestore/query.go:493:8: undefined: "google.golang.org/genproto/googleapis/firestore/v1".StructuredQuery_FieldFilter_IN
../../go/src/cloud.google.com/go/firestore/query.go:497:8: undefined: "google.golang.org/genproto/googleapis/firestore/v1".StructuredQuery_FieldFilter_ARRAY_CONTAINS_ANY

I'm running macOS 10.15 and Go 1.12.6

Remove command?

Would it be possible to add a remove command? Reason being, Google IoT requires a-z or A-Z for device ID's -- so if fuego creates a device and it starts with a number, i need to remove the collection but don't see any way to do that with fuego

The flag --merge of the set command does not work

The following command (directly taken from the doc)
fuego set --merge Msg_Conversation 8ec617d5-37d4-4841-9678-a22939cf8638 '{"messageCount": 1}'
leads to this error:
Incorrect Usage: flag provided but not defined: -merge

(whithout the --merge flag it set and does not update the database entry)

By the way, thanks for this repo, it's incredibly helpful and usually works great :)

No Error on deleting non-existing Document

With executing fuego delete col/<non-existing-id> you do not get an error message.
This could lead to some probems in case of a typo.

Adding an additional flag to enable an 'existence check', could solve the issue.
e.g.

$ fuego delete --check-existence col/<non-existing-id>
Error: Trying to delete non-existing document

Support leading `/` in document path

Doing fuego get /absolute/path/to/document fails with

Failed to get data.
firestore: nil DocumentRef

This should succeed, as this is a correct absolute document path.

Doing fuego get absolute/path/to/document succeeds (no leading /)

GeoPoint data type not supported

If I save a document with GeoPints data type to a JSON and then I reload it then the new data have 'latitude' and 'longitude' fields instead od GeoPoints

Query on a field of type 'reference'

It is currently not possible to query on documents that are field references.

fuego query collection 'ref == "/otherCollection/id"' returns nothing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.