- 2015-08-21: 50% less server load with MongoDB on the Drupal 7 site factory at France Télévisions
- 2015-07-15: Our first Drupal 8 production site at France Télévisions is live
- 2014-08-18: 400% speedup in 3 weeks for http://france3-regions.francetvinfo.fr/ : who said Drupal back-offices had to be slow ?
- 2014-02-07: Sotchi Olympics traffic not a problem for http://www.francetvsport.fr/ , which I rearchitected on Drupal 7 in 2013
- 2011-09-14: Completed migration of FranceInfo.FR from SPIP to Drupal
- 2011-07-13: The new social network features of Le Figaro are now powered by an OSInet-designed MongoDB implementation
- 2010-12-21: Madame Figaro brand new site by OSInet and others
- 2010-08-16: France.FR is back online with OSInet and Typhon
- 2010-06-15: the new France Culture, which OSInet helped reach its performance goals, is now online
Drupal tip of the day: how to drop the Simpletest collections when using Drupal with MongoDB
When running tests on a server using the recent versions of the MongoDB module for Drupal, and more specifically the MongoDB simpletests, the simpletest runner may leave droppings in your MongoDB Drupal database, which have no business remaining there. How to remove them while keeping the good collections ?
The typical case will be after a failed test runs, looking like this:
> use drupal switched to db drupal > show collections cache cache_admin_menu cache_block cache_bootstrap cache_field cache_filter cache_image cache_menu cache_page cache_path cache_token cache_views simpletest129468watchdog simpletest13031cache simpletest13031cache_bootstrap simpletest13031cache_field simpletest13031cache_form simpletest13031cache_menu simpletest311707cache simpletest311707cache_bootstrap simpletest311707cache_field simpletest311707cache_menu simpletest315780cache simpletest315780cache_bootstrap simpletest315780cache_field simpletest315780cache_menu simpletest324614watchdog simpletest885830cache simpletest885830cache_bootstrap simpletest885830cache_field simpletest885830cache_form simpletest885830cache_menu simpletest983006watchdog system.indexes system.profile watchdog
Of course, in most cases, you will just do a
db.dropDatabase() and be done with it, but sometimes you want to keep your cache, path, sessions, or watchdog eollections. Here is a simple script to do it. It's normally a one-liner, but I indented it in the gist for readability
The little trick is the use of
db[e] : in such a loop, using the usual Mongoshell-style
db.e.drop() won't work, because at this point
e is a variable containing the name of the collection, not an actual collection object, so it does not carry methods like
drop() (hence failing the former syntax), and is not itself the name of the collection (hence failing the latter syntax).