Use the 'output' key instead of 'write' for writing out collections' document files.