Adjust query

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

You can adjust the query for migrations by overriding the query function.
Below are some examples to limit the amount of nodes you migrate.

protected function query() {
    $query = parent::query();
    //$query->condition('n.nid',2161); // only migrate the node with nid 2161
    //$query->condition('n.nid',array(1849,2161)); // only migrate the nodes with nid 1849 or 2161
    $query->range(0, 50); // only migrate the first 50 results
    return $query;
}

For more information about the syntax check the database api documentation.
http://drupal.org/developing/api/database

Help improve this page

Page status: Not set

You can: