- UrlValidator ping use checkdnsrr
- Fixed in building docker environment
- Changed return values of rename methods of Collection
- Added method to rename collection
- Add $elemMatch to projection argument of
Cursor
Cursor
methodsfindOne
,findAll
,findRandom
deprecated, useone
,all
andrandom
respectively;- Allow pass filter to docker tests
- Document's
afterConstruct
event triggered with document instance
- Cache now compatible with PSR-16;
- Cache setters now return bool instead of exceptions to be compatible with PSR-16;
- Cache::setNeverExpired and Cache::setDueDate now deprecated. Use Cache::set instead;
- Fix searching documents with regex #148
- Fix collection creation with empty options
- Allow specify validator while create collection
- Fixed mispell in method name BatchInsert::isValidationEbabled
- Fixed usage of validation flag in BatchInsert
Document::beforeConstruct
moved toStructure::beforeConstruct
so embedded documents may configure some logic thereCollection::batchDelete()
now has required argument- Now may be configured batch limit in
Cursor::copyToCollection
andCursor::moveToCollection
- Methods of
\Iterator
interface currently not recommended to use directly inCursor
andPaginator
. But if used, nowrewind
MUST be calls beforecurrent
. - Remove debug logger calls
- Implemented support of new ext-mongodb and, as a result, PHP7 and HHVM through compatibility layer "alcaeus/mongo-php-adapter", which implement API from old ext-mongo extension;
- Cursor::findOne() throws internal
CursorException
exception instead of related to mongo extension. Exception from extension may be obtained from internal exception; - Document::save() throws internal
WriteException
exception instead of related to mongo extension. Exception from extension may be obtained from internal exception; - Docker tests now check PHP 7 code
- Structure::apply() now protected
- Fix bug in Document::addToSet
- Docker config improvements
- Fix bug #132 in Document::push
- Configure document pool status in collection's mapping;
Collection::_mongoCollection
is deprecated. UseCollection::getMongoCollection()
instead;Collection::ensureIndex()
is deprecated, useCollection::createIndex()
;Cursor::toArray()
removed, useCursor::getMongoQuery()
;Document::belongsToCollection()
removed, useCollection::hasDocument()
;Document::FIELD_TYPE_*
constants removed, useFieldType
enumCollection::_database
removed, use Collection::getDatabase() instead;
- Docker tests
- Support of DBRefs
Client::$_mapping
set private.Use Client::map()
- Configure document class if collection class also configured by class prefix #128
- Fixed aggregation pipeline setter
- Allow set embedded document and validate it;
\Sokil\Mongo\Structure\Arrayable
moves to\Sokil\Mongo\ArrayableInterface
;Structure::$_modifiedFields
andStructure::$_originalData
set private;- Document::_data is now deprecated, and replaced with protected property Document::schema;
- Documents not allowed to be cloned;
- Removed 'validator' suffix from names of validation errors in array of validation errors obtained from Document::getErrors();
- Update version of Event Dispatcher
- Allow delete indexes
- Removed
Collection::createPipeline()
. UseCollection::createAggregator
; - Aggregator options may be passed as arguments of
Collection::aggregate($pipelines, $options)
or configured through methods ofPipeline
; - Experimental feature: aggregation returns Cursor, if third parameter passed
Collection::aggregate($pipelines, $options, $asCursor)
; Collection::explainAggregate()
is deprecated. UsePipeline::explain()
;- Added debug mode to
Client
;
- Fulltext search
- Fixed bug #121 - Getting relation when document pool disabled
- Added $addToSet operator
- Add support of batch operations
- Support of $unwind pipeline in aggregation
- Fix getting HAS_ONE and BELONGS relation when related object not found;
- Cache detected db version
- Cursor autocomplete improves
- Use
MongoWriteBatch
classes when using unit of work
- Added support of cursor timeouts
- Added
Database::getLastError()
- Optimistic locking
- Refactoring of mapping configs.
- Default argument removed from
Collection::getOption()
. - Removed deprecated method
Collection::saveDocument()
. - Removed deprecated method
Client::setConnection()
. Use Client::setMongoClient(). - Removed deprecated method
Client::getConnection()
. Use Client::getMongoClient(). - Removed
Document::pushFromArray()
. UseDocument::pushEach()
. - Removed
Paginator::setQueryBuilder()’. Use
Paginator::setCursor()`. - Removed
Document::fromArray()
. UseDocument::merge()
instead. - Removed
Structure::load()
. Usemerge
ormergeUnmidified
instead. - Revision methods moved to
RevisionManager
. Call them fromDocument
instance directly is deprecated. UseDocument::getRevisionManager()
instead. - Mark Document::_scenario as private.
- Define relations in mapping.
Operator::getAll()
is deprecated. UseOperator::toArray()
.- Protected access of property Structure::_modifiedFields is deprecated. Use self::getModifiedFields().
- Protected access of property Structure::_originalData is deprecated. Use self::getOriginalData().
- Removed classes QueryBuilder and GridFSQueryBuilder. Hydration logic improved
- Refactor document saving
- Collection::deleteDocument() is deprecated. Use Document::delete()
- Collection::isVersioningEnabled() and Collection::enableVersioning() are deprecated. Use 'vrsioning' in mapping.
- Collection properties 'documentClass', 'versioning', '_index' and '_queryExpressionClass' are deprecated. Use mapping declarations instead.
- Method 'Validator::validate()' marked as final
- Refactoring or document relations
Document::belongsToCollection()
now deprecated. Use Collection::hasDocument()- Refactor document events
- Define cursor's batch size
- Accept expression array and callable when call
Collection::getDistinct()
- Fix update when expression defined as callable
- Fix deleting documents when expression specified as callable
- If callable in
Dollection::getDocument()
specified, document always loaded directly omitting document pool. - Fixed 'in' validator when custom error message specified
- Dependency from major version number of Symfony Event Dispatcher
- Fixed bug with naming of validator in errors array. Removed suffix 'validator'.
- Behavior refactoring.
- Old validator name is kept for back compatibility and will be removed in next versions
Operator
refactoring and bugfixes- Fix Collection::update when update data set as array
- Set
Structure
to document as embedded document
- Apply chain of functions over result set
- Bug with passing behaviors, configured in mapping, to documents
- Refactor document validation exceptions. Exception
\Sokil\Mongo\Document\Exception\Validate
deprecated. Use\Sokil\Mongo\Document\InvalidDocumentException
. - Allow to get matched params on regex mapping.
- Configure cursor when get document by id to slice embedded documents or other reason
- Add
Collection::update()
method that allow to define different update options - Refactoring and bugfixes
- Allow unset field end check for empty value by php functions
unset
andisset
- Attach behaviors in mapping
- Bugfixes
- Fixed bug with default values of collection options
- Happy New Year
AggragetePipelines
class renamed toPipeline
. If you in some reason use it directly, use factory methodCollection::greateAggregator()
instead- Added some aggregation group accumulators and expressions
- Query builder's expression may be configured in mapping
Client::setConnection()
deprecated sice 1.8.0. UseClient::setMongoClient()
Client::getConnection()
deprecated sice 1.8.0. UseClient::getMongoClient()
- Overloading of query builder through
Collection::$_queryBuilderClass
is deprecated and will be marked as private. Overload expressionCollection::$_queryExpressionClass
instead Collection::saveDocument()
deprecated since v.1.8.0. UseDocument::save()
method- Collection::createPipeline() deprecated since 1.10.10, use
Collection::createAggregator()
or callable inCollection::aggregate()
Document::fromArray()
deprecated useDocument::merge()
insteadDocument::pushFromArray()
deprecated since 1.6.0 useDocument::pushEach()
insteadPaginator::setQueryBuilder()
deprecated since 1.2.0 usePaginator:::setCursor()
Structure::load()
deprecated since 1.8.1 and will be removed in next versions. Use concrete merge methods
- Initial functionality