Thanks for sharing Cliff!
On Dec 9, 3:53 am, Cliff <[email protected]> wrote: > db.mytable.truncate() cleans all the data out of the table, but does > not reset the counter for the id field. (See Ch 4 of the book.) > > db.products.truncate('RESTART IDENTITY CASCADE') resets the counter > back to zero, so the first record gets an id of 1. > > Resetting the counter is useful for automated testing.

