Flamelink uses a flat collection structure for all data managed in your Cloud Firestore database.

All the Flamelink specific collection names start with a fl_ to make them easily recognisable.

Why does Flamelink store all my content in one collection?

If you take a look at your database, you'll see that Flamelink stores all the content specific data in one collection, called fl_content. You might wonder about this. Won't it create performance problems? The great news is that Cloud Firestore's query performance is based on the size of the result set, ie. the number of documents in the result of your query and not based on the size of the collection itself. For this reason, there is not a problem with performance using a single collection. Furthermore, using a single collection makes keep your content in sync a much easier task.

If you need to query the content for a specific schema in a specific environment for a given language, you can construct your query with numerous where  clauses using
the specific properties in each document's _fl_meta_ map. 

For arguments sake, let's say you want all the entries for a categories schema for the default environment and language, production and en-US respectively, your constructed query could look something like this (JavaScript example - see the Firebase documentation for your language of choice):

firebase
  .firestore()
  .collection('fl_content')
  .where('_fl_meta_.env', '==', 'production')
  .where('_fl_meta_.locale', '==', 'en-US')
  .where('_fl_meta_.schema', '==', 'categories')
  .get()


If you use one of our official SDK's to query your content, this is handled for you, so you do not need to worry about it.

I want to set custom security rules, what are all the Flamelink collections?

If you want to specify custom rules for your Firestore collections, you'll have to set the rules for each of the Flamelink collections. Unfortunately, Firebase does not currently support specifying rules with wildcards in the collection name, because then you would be able to easily set a rule for all collections starting with fl_ . Hopefully we'll get that soon.

In the mean time, here is a list of all the current Flamelink collections. If your project login starts to fail after a new feature has been released, it might mean we have a new collection and your rules are not allowing us to read it yet.

fl_backups
fl_content
fl_environments
fl_files
fl_folders
fl_locales
fl_navigation
fl_permissions
fl_schemas
fl_settings
fl_users
fl_webhooks
fl_webhooks/{document}/activityLog
fl_workflows

An example rule would look like this:

match /fl_content/{document} {
  allow read, write: if true;
}

You might have noticed for the Webhooks collection, we also have an activityLog  subcollection. If you're using custom rules, you'll have to explicitly set read rules for this subcollection to access it from within the app.

match /fl_webhooks/{document} {
  allow read, write: if true;
}
     
match /fl_webhooks/{document}/activityLog/{log} {
  allow read, write: if true;
}
Did this answer your question?