Skip to content

Releases: TCB13/sequel-mongo-php

Pull From Everywhere

23 May 17:47
Compare
Choose a tag to compare

Improved ArrayPull: pull strings from arrays or objects matching conditions from arrays of objects.

Remove individual value from array:

new ArrayPull("list", "user.123")

Remove multiple values from array:

new ArrayPull("list", ["user.123", "user.456"])

Remove objects from array of objects based on condition:

new ArrayPull("list", ["id" => ["user.123", "user.456"]])
new ArrayPull("list", ["id" => "user.123"])
new ArrayPull("list", ["id" => "user.123", "name" => "joe"])

Identify

15 May 11:34
Compare
Choose a tag to compare
  • QueryBuilder::select fix always missing _id property.

Push you all!

24 Apr 15:08
Compare
Choose a tag to compare
  • Add multiple items to an array at once using ArrayPush.

Count Better

10 Apr 11:20
Compare
Choose a tag to compare
  • Improve QueryBuilder::count().

Custom Pipelines

09 Apr 13:35
Compare
Choose a tag to compare
  • Run queries with your own custom pipelines with the QueryBuilder::pipeline() method;
  • More PSR.

ArrayLength

22 Mar 17:29
Compare
Choose a tag to compare
  • Use the ArrayLength special function in select() and filter your results by the obtained length with where().

Unwind Yourself!

20 Mar 12:33
Compare
Choose a tag to compare

Adds unwind(string $path, ?string $includeArrayIndex = null, bool $preserveNullAndEmptyArrays = false)

Pull Away!

12 Mar 14:31
Compare
Choose a tag to compare

ArrayPull: Now optionally accepts an array of values instead of just one for the same property. Example:

$tokensToRemove = ["token1", "token2", "token3"];
 $result = (new QueryBuilder())->collection("Users")
            ->where("active", true)
            ->update([new ArrayPull("pushtokens", ["token" => $tokensToRemove])]);

From any model with a pushtokens property that is an array of objects containing a token property, remove entries that are in $tokensToRemove.

Objectify MongoDB

11 Mar 11:39
Compare
Choose a tag to compare

New features:

  • Direct Insert / Update of objects into MongoDB is now possible. Objects must implement MongoDB\BSON\{Serializable, Unserializable} interfaces. This allows you to implement your own custom serialization/deserialization operations.
    Improvements and bug fixes:
  • QueryBuilder::deserializeResult() is now public. Can be used instead of ::toArray() or ::toObject() to get results deserialized as you would like. Read http://php.net/manual/en/mongodb.persistence.deserialization.php for more info;
  • More PSR.

IndexBy

05 Mar 15:05
Compare
Choose a tag to compare
  • Added indexBy to QueryBuilder.