using filename as id for demo purposes, also changed to read from stdin so we can cat existing documents to it