use $document, add example