-
Notifications
You must be signed in to change notification settings - Fork 102
Cloud Firestore Representation
This page describes how Ground data is structured in Cloud Firestore. For definitions of terminology used throughout this document, please refer to Key Concepts.
Cloud Firestore databases are composed of collections (π) and documents (π). Collections may contain one or more documents, which themselves may can contain other collections, and so on, ad infinitum. For a full explanation see Cloud Firestore Data Model.
Ground data is organized in Cloud Firestore as follows:
πprojects/ π${projectId} πfeatures/ π${featureId} πobservations/ π${observationId} πusers/ π${userId}
Where ${projectId}, ${featureId}, ${observationId}, etc., indicate zero or more documents keyed by auto-generated UUIDs.
User-defined multilingual strings like title and description are stored as
associative arrays keyed by ISO-639 language code.
Path: /projects/${projectId}
Project settings, form definitions, and ACLs defined by project managers are stored in documents with the following structure:
{
title: { 'en': 'Project title' },
description: { 'en': 'Project description' },
owner: 'user1234',
layers: {
layer001: {
name: { 'en': 'Layer name' },
zIndex: 1,
forms: {
formId: {
elements: [
{
id: 'element001',
label: { 'en': 'Question 1' },
required: true,
type: 'text_field'
},
{
id: 'element002',
label: { 'en': 'Question 2' },
required: false,
type: 'multiple_choice',
cardinality: 'select_one',
options: [
{
code: 'A',
label: { 'en': 'Option A' }
},
// More options...
]
},
// More elements...
]
}
}
}
},
acl: {
user001: 'viewer',
user002: 'contributor',
user003: 'manager',
// More users...
}
}{
location: {
latitude: -74.0060,
longitude: 40.7128
},
layerId: 'layer1234'
}TODO: Merge in description from https://github.com/google/ground-platform/issues/9.