Index: library/mongodb/example-nx-mongo.tcl =================================================================== diff -u -r5f281c1ff709a771d08362ee9593dcbe76ebbb2b -ra77464d1f7a06117c621560ec519dc4d387ed5df --- library/mongodb/example-nx-mongo.tcl (.../example-nx-mongo.tcl) (revision 5f281c1ff709a771d08362ee9593dcbe76ebbb2b) +++ library/mongodb/example-nx-mongo.tcl (.../example-nx-mongo.tcl) (revision a77464d1f7a06117c621560ec519dc4d387ed5df) @@ -12,10 +12,13 @@ ::nx::mongo::db connect -db "tutorial" # Make sure, we start always from scratch + nx::mongo::db remove tutorial.persons {} +if {[::mongo::count [::nx::mongo::db eval {set :mongoConn}] tutorial.persons {}] > 0} { + # when we create a capped colletion, we have to use "drop collection" to get rid of it. + nx::mongo::db drop collection persons +} -::mongo::run [::nx::mongo::db eval {set :mongoConn}] tutorial {drop string persons} - # # Create the application class "Person" #