mongodb でカウンターを設置する方法

in mongodb , documents are put in collection like an array. but when i want to introduce a counter property which is to remember the last id it has dispatched to those new documents, where and how should i prepare such a counter ? should i prepare another collection with a single document and prepare a field an integer field named "last_id"?