Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.8 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.8 KB

Firestore Kotlin Sample

Open in Cloud Shell

Description

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.

Quickstart

Setup

Build

  • 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 build -info

You should now have a 'firestore.jar' file under build/libs/

Running the sample

Usage: java -jar build/libs/firestore.jar 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.

Contributing changes

Licensing