When I run [my_document].save
the first time it runs no problem, creates the collection and saves the document.
When I run it the second time (and any subsequent times), I receive the error 'collection already exists'; code: '48'
.
I am running mongo 3.2.0
and mongoid 2.4.7
.
If I run db.dropDatabase();
in the mongo console, then I can run it again without trouble...but just once. After that, it won't work at all.
I can also delete the tmp/mongodb/[my_collection]
directory manually, and it works again...just once, and not again.
I've run brew uninstall mongodb
and brew install mongodb
more than once to no avail; same behavior.
Rather frustrating. Of course the collection exists. It should exist. And it shouldn't be a problem. Any assistance would be much appreciated.
Aucun commentaire:
Enregistrer un commentaire