# Services : Firebase : Firestore - You can have up to 100 databases per project. - You start with the "(default)" database. - IDs: 4-63 lowercase letters, numbers, and hyphens - Clients connect to "(default)" by default. To connect to a named db, set the db ID when you instantiate a client. - All documents must be stored in named collections. - Documents are named, limited to 1mb, and can contain subcollections and nested objects, both of which can include primitive fields like strings or complex objects like lists. - Deleting a document does not delete its subcollections! - The names of documents within a collection are unique. - You can provide your own keys, such as user IDs, or you can let Cloud Firestore create random IDs for you automatically. - You do not need to explicitly create collections or documents. Firestore creates collections and documents implicitly the first time you add data to the document. - You do not need to explicitly delete collections - they disappear when empty. #### Data Structure Nestable to 100 levels. ``` Nestable to 100 levels. {rooms} (collection) <roomA> (document) name: "..." k/v pair {messages} (subcollection) <message1> (document) from: "..." k/v pair msg_ref = doc( db, "rooms", "roomA", "messages", "message1" ); {col} <doc> {col} <doc> ``` #### Data Types ``` Array cannot contain arrays Boolean Bytes Date and time down to microseconds Floating-point number Geographical point not recommended Integer Map NaN Null Reference Text string UTF-8 Vector up to 2048 dimensions ```