Skip to content

Latest commit

 

History

History

firestore

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 installDist -info

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

Running the sample

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.

Contributing changes

Licensing