Display all taxonomy terms's ids associated with nodes in a view
Add field "All taxonomy terms". Then check the "rewrite output of this field" box, and in the rewrite box enter the token [term_node_tid-tid].