This simple command-line application demonstrates how invoke the Google Cloud Firestore API from a Kotlin application.
Check out the sample code in quickstart.kt and firestore.kt.
- Configure your project to use Cloud Firestore in Native mode.
- Enable Cloud Firestore API inside your Google Cloud project.
- Set up authentication.
- Clone the repository
git clone https://github.com/GoogleCloudPlatform/kotlin-samples cd kotlin-samples/firestore
- Build the project with Gradle Wrapper:
# run with "-info" flag to print potential errors ./gradlew installDist -info
You should now have a 'firestore.jar' file under build/libs/
Usage: build/install/firestore/bin/firestore YOUR_COLLECTION_NAME [KEY] [VALUE]
- Running with a collection name will print all keys and values in the collection.
- Running with a collection name and key will print the key/value pair.
- Running with a collection name, key, and value will set the key to that value.
- See CONTRIBUTING.md
- See LICENSE