Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-12

Implement Collection::find()

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Although the filter argument is listed explicitly in the signature, it is still optional. It was not included in the options array to allow for BC, since most drivers currently take it as the first parameter.

      Usage example:

      $collection->find(
          // Optional criteria param, which we allow as the first positional argument for BC
          ['x' => 1],
          // Optional named params in an associative array (BC break, projection in 1.x)
          ['limit' => 10]
      );
      
      $collection->find(
          // Optional criteria param, which we allow as the first positional argument for BC
          [],
          // Optional named params in an associative array (BC break, projection in 1.x)
          [
              'skip' => 20,
              'sort' => array("firstName" => 1),
              'modifiers' => array('$showDiskLoc' => true),
          ]
      );
      

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: