We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firestore-one-to-many
Implements the one-to-many relationship between Firestore collections.
The path to the collation containing the documents represents the first side of the relation, the "one" side. Example: authors
authors
The path to the collation containing the documents represents the second side of the relation, the "many" side. Example: books
books
The name of the field in the destination collection that contains the reference of the document in the target collection. Example: authorId
authorId
The name of the field in the target collection where the id of the destination document will be stored. Example: bookId Default: id
bookId
id
The name of the field in the target document where the list of the destination documents will be stored. Example: books
The name of the field in the destination document where the data from the target document will be stored. Example: author
author
A comma-separated list of field names to copy from the target collection to the destination collection. Example: name,biography
name,biography
A comma-separated list of field names to copy from the destination collection to the target collection. Example: title,summary
title,summary
What should happen to the documents in the destination collection when a related target collection is deleted?
The text was updated successfully, but these errors were encountered:
Hey! I think I was able to add this features to my project - would you like to check my code and take a look if you could use it?
Sorry, something went wrong.
No branches or pull requests
Implements the one-to-many relationship between Firestore collections.
Params 🛠️
Target Collection Path
The path to the collation containing the documents represents the first side of the relation, the "one" side.
Example:
authors
Destination Collection Path
The path to the collation containing the documents represents the second side of the relation, the "many" side.
Example:
books
Target Ref Field Name
The name of the field in the destination collection that contains the reference of the document in the target collection.
Example:
authorId
Destination Ref Field Name
The name of the field in the target collection where the id of the destination document will be stored.
Example:
bookId
Default:
id
Target Data Field Name
The name of the field in the target document where the list of the destination documents will be stored.
Example:
books
Destination Data Field Name
The name of the field in the destination document where the data from the target document will be stored.
Example:
author
Fields to copy from the target collection
A comma-separated list of field names to copy from the target collection to the destination collection.
Example:
name,biography
Fields to copy from the destination collection
A comma-separated list of field names to copy from the destination collection to the target collection.
Example:
title,summary
Target document deletion behaviour
What should happen to the documents in the destination collection when a related target collection is deleted?
The text was updated successfully, but these errors were encountered: