Writes a variable in a collection as document.
The collection where to store the variable.
The name under which the variable will be saved (document name).
The variable to write.
Optional
The variable where to store the result.
Writes a variable in a collection as document.