Main RSS Feeds

MongoDB

On behalf of all contributors to the MongoDB module suite for Drupal
over the years, I am pleased to announce the 8.x-2.0-alpha1 release of the
MongoDB package for Drupal 8, six years after we started this project on
Drupal 6.

This release is the first step to an initial stable release of the MongoDB
package for Drupal 8, containing:

mongodb a module exposing the new PHP library as Symfony
services exposed to a Drupal 8.x instance. It is designed as a minimal and
consistent connection layer on top of the PHP library for MongoDB, for all
modules targeting MongoDB on Drupal 8.x, be they contributed or bespoke.

mongodb_watchdog a PSR-3 logger storing event data in
MongoDB. On top of the features already present in 6.x and 7.x versions,
it introduces a per-request report showing all events logged during a
request, in order.

The problem

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 ?

One nice thing during Drupal 7/8 development is the ability, thanks to the devel module, to get a list of all SQL queries ran on a page. As I've been working quite a bit on MongoDB in PHP recently, I wondered how to obtain comparable results when using MongoDB in PHP projects. Looking at the D7 implementation, the magic happens in the Database class:

Just noticed this little gem on a 10Gen course, about the respective names of the CRUD operations in common practice, versus the equivalent operations in SQL and in MongoDB. Links point to Wikipedia for SQL and the relevant MongoDB documentation page for the MongoDB column.