Uploaded image for project: 'PHP ORMs'
  1. PHP ORMs
  2. PHPORM-138

Implement whereColumn using aggregation builder

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Laravel
    • None

      joseraul has created Issue #1651: whereColumn feature missing in laravel-mongodb

      Issue Text:
      Hi!

      I think is not possible to use the `whereColumn`, right?
      Is there any special reason because it is not implemented?
      I will be happy to help


      Adding a use case for whereColumn.
      We recalculate items every day that is within the period (date_first_in_period, date_last_in_period).

            
      $builder = BenchmarkCacheModel::query()
                  ->where('filter_alias', $filterAlias)
                  ->whereColumn('date_last_in_period', '>=', 'updated_at');
              $keyItemArray = $builder->get()->toArray();
      

       
      Unfortunately this does not work since whereColumn is not implemented: "BadMethodCallException: This method is not supported by MongoDB"

      MongoDb itself can do this with aggregations. I will have to solve this for now with a raw call.

            Assignee:
            Unassigned Unassigned
            Reporter:
            tom.selander@mongodb.com Tom Selander
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: