Skip to content

Releases: mongodb/laravel-mongodb

v2.1.2

22 Mar 20:31
Compare
Choose a tag to compare
  • Fixes issue with sync for many to many relations
  • Fixes issue with lists by primary key

v2.0.5

22 Mar 20:46
Compare
Choose a tag to compare
  • Fixes issue with sync for many to many relations
  • Fixes issue with lists by primary key

v2.1.1

05 Mar 19:51
Compare
Choose a tag to compare
  • Better MongoDB DSN generation.
  • You can now also directly pass the DSN string to set up a connection.

v2.0.4

16 Feb 14:25
Compare
Choose a tag to compare
  • Laravel 4.2.17 support

v2.1.0

24 Feb 08:52
Compare
Choose a tag to compare
  • Temporary tag for Laravel 5

v2.1.0-beta

11 Feb 16:59
Compare
Choose a tag to compare
v2.1.0-beta Pre-release
Pre-release
  • Laravel 5 support

v2.0.3

04 Feb 10:38
Compare
Choose a tag to compare
  • Fixes issue #325
  • Fixes compileWhereIn for MongoDB 2.6.0
  • Removed unused imports

v2.0.2

16 Sep 11:05
Compare
Choose a tag to compare
  • Fix for Laravel 4.2.9.

v2.0.1

11 Aug 10:05
Compare
Choose a tag to compare
  • Revert service provider code, fixes #280.
  • Support for 'regexp' and 'not regexp' operations, check readme for more information.

v2.0.0

10 Aug 09:08
Compare
Choose a tag to compare

Embedded Relations

In this new version, embedded documents are no longer saved to the parent model using an attribute with a leading underscore. If you have a relation like embedsMany('Book'), these books are now stored under $model['books'] instead of $model['_books']. This was changed to make embedded relations less confusing for new developers.

If you want to upgrade to this new version without having to change all your existing database objects, you can modify your embedded relations to use a non-default local key including the underscore:

$this->embedsMany('Book', '_books');

Additionally, working with embedded models has become a lot easier. With this release, you can use the update, save and delete methods on the embedded models directly, instead of going through the relation instance of the parent model. Example:

$user = User::create(array('name' => 'John Doe'));
$address = $user->addresses()->create(array('city' => 'New York'));

$address->city = 'Paris';
$address->save();

Embedded relations will return a Collection of embedded items instead of a query builder. To allow a more query-like behavior, embedded relations return a modified version of the Collection class with support for the following additional operations:

  • where($key, $operator, $value)
  • whereIn($key, $values) and whereNotIn($key, $values)
  • whereBetween($key, $values) and whereNotBetween($key, $values)
  • whereNull($key) and whereNotNull($key)
  • orderBy($key, $direction)
  • oldest() and latest()
  • limit($value)
  • offset($value)
  • skip($value)

This allows you to execute basic where queries on the collection results.

Embedded relations should now handle deeply nested relations a lot better. However, this does not produce optimal database queries, so use it with caution.

Model

The model class now supports keys in dot notation. This was added to fix an issue where local and/or foreign keys for relations were inside a sub-object.

Push and pull operations now also change the internal attributes of the model, opposed to only executing a query in the previous version.

Query builder

The query builder now supports projections using the project method. The array that you pass to this method will be passed to the find queries.

You can now also set a timeout value for the Cursor objects using the timeout method. This will automatically set the timeout on the Cursor result before converting it to an array of results.

Belongs to many

The belongs to many relation was updated and now automatically pushes/pulls the id's to/from the model object. This prevents duplicate ids from being stored.

Password reminders

The included ReminderServiceProvider was modified so that password reminders are saved with a MongoDate.