The firestoreAdd
function is a higher-order function that takes a collection path and an options object, and returns a function that can be used to add documents to the specified collection.
data
property of the arguments object which contains the data that will be written to the document:
DocumentReference
to the newly created document.
firestoreAdd
is an optional object allowing for additional configuration. This object can have a property addMetadata
which, if true, adds metadata to the document.
addMetadata
option is not specified, the function will operate without adding any additional metadata to the document. This default behavior is suitable for scenarios where metadata is not required, offering flexibility based on your needs.
firestoreAdd
: