Skip to content

How to query a collection and return a random document? #180

Answered by BearDooks
InfiniteNex asked this question in Q&A
Discussion options

You must be logged in to vote

@InfiniteNex Sorry it took so long to get back to you.

In terms of selecting a random document in a collection, I would need to look into that. You are honestly the first person that has asked the question.

In regards to printing the document, take a look at this part of the wiki: https://github.com/GodotNuts/GodotFirebase/wiki/Firestore#get-a-document

You can also look at this test code I have when we test a new version of the plugin

# Connect to the collection
_collection = Firebase.Firestore.collection('Firebasetester')
    
# Connect needed signals for testing
_collection.connect("add_document", self, "on_document_add")
_collection.connect("get_document", self, "on_document_get")
_col…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fenix-hub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants