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

Integrate query builder for non-aggregation APIs

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.21.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • PHP Drivers
    • Needed
    • Hide

      Document the usage of the query builder with find and update methods.

      Show
      Document the usage of the query builder with find and update methods.

      The aggregation builder includes a builder for queries used in $match that can also be used to construct queries for non-aggregation contexts, such as MongoDB\Collection::find(), MongoDB\Collection::delete(), or MongoDB\Collection::update(). With the encoder option set on the client/database/collection object, these queries can be converted to BSON query objects that the server understands.

      The builder supports functionality not supported in $match (such as $near or $where), making this a full-fledged builder for all methods that take a filter option. While $match would also accept those operators (which then would cause a server error when running the pipeline), creating separate types for queries and the $match operator is not feasible, as it requires duplication of all query operators. This would also prevent reusability of query objects in methods that take a filter and $match stages in pipelines.

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: