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

Accept operators prefixed by `$` in `Query\Builder::orWhere`

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • laravel-4.0.0
    • Affects Version/s: None
    • Component/s: Laravel
    • None

       

      fn (Builder $builder) => $builder
          ->where('foo', '$type', 2)
          ->orWhere('foo', '$type', 4), 

      Should make this call:

      find({ $or: [
          { foo: { $type: 2 } },
          { foo: { $type: 4 } }
      ]})

      Currently, the operator of the 2nd is not reconized and produces an inconsistant query:

       

      find({ $or: [
          { foo: { $type: 2 } },
          [ foo: "$type" }
      ]}) 

       

       

       

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

              Created:
              Updated:
              Resolved: