laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

MIT License

Downloads
13.2M
Stars
6.9K
Committers
198

Bot releases are hidden (Show)

laravel-mongodb - v2.0.3

Published by jenssegers over 9 years ago

  • Fixes issue #325
  • Fixes compileWhereIn for MongoDB 2.6.0
  • Removed unused imports
laravel-mongodb - v2.0.2

Published by jenssegers about 10 years ago

  • Fix for Laravel 4.2.9.
laravel-mongodb - v2.0.1

Published by jenssegers about 10 years ago

  • Revert service provider code, fixes #280.
  • Support for 'regexp' and 'not regexp' operations, check readme for more information.
laravel-mongodb - v2.0.0

Published by jenssegers about 10 years ago

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.

laravel-mongodb - v1.4.3

Published by jenssegers about 10 years ago

  • Adjust connection handling for Laravel 4.2.8
  • Allows different _id types
  • Improved service provider
laravel-mongodb - v1.4.2

Published by jenssegers about 10 years ago

  • Enabled logging for raw queries.
  • Added exposed attribute to expose the internal embedded documents.
  • Supports more mongodb operators.
laravel-mongodb - v1.4.1

Published by jenssegers over 10 years ago

  • Tweaked _id handling, fixes #225.
  • Added more Mongo specific operators.
laravel-mongodb - v1.4.0

Published by jenssegers over 10 years ago

  • Switched to Laravel 4.2, the older version is available in the 4.1 branch.
  • Includes Jenssegers\Mongodb\Eloquent\SoftDeletingTrait for soft deletion.
laravel-mongodb - v1.3.2

Published by jenssegers over 10 years ago

  • Added associate for embedsOne.
  • Allows disabled timestamps for embedded models.
  • Fixed multiple nested 'or' queries.
laravel-mongodb - v1.3.1

Published by jenssegers over 10 years ago

  • Adding initial port for has on hasOne and hasMany relations.
  • Fixed belongsTo and belongsToMany hybrid relations.
laravel-mongodb - v1.3.0

Published by jenssegers over 10 years ago

laravel-mongodb - v1.2.9

Published by jenssegers over 10 years ago

  • Added the delete method for embedded models
laravel-mongodb - v1.2.8

Published by jenssegers over 10 years ago

  • Changes for Laravel v4.1.26
laravel-mongodb - v1.2.7

Published by jenssegers over 10 years ago

  • Fix _id conversion for toArray and toJson
  • Improved date conversion
laravel-mongodb - v1.2.6

Published by jenssegers over 10 years ago

  • EmbedsMany now returns the correct result for find
  • Cleaned up the MorphTo relation
  • toJson now uses getDateFormat
  • Increased test coverage
laravel-mongodb - v1.2.5

Published by jenssegers over 10 years ago

  • Prevent duplicate embedsMany objects
  • Added count method to embedsMany relation object
laravel-mongodb - v1.2.4

Published by jenssegers over 10 years ago

  • Modification for Laravel 4.1.24
  • Fixes infinite loop on EmbedsMany
  • Increased test coverage
laravel-mongodb - v1.2.3

Published by jenssegers over 10 years ago

laravel-mongodb - v1.2.2

Published by jenssegers over 10 years ago

laravel-mongodb - v1.2.1

Published by jenssegers over 10 years ago

  • Fixes belongsToMany issue that did not correctly remove ids on related models.
  • Fixes pull on model instances.
  • Adds natural order sorting.