From f2f8fff6e9e1781e31940f23272dd043dfc16c9e Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Tue, 10 Apr 2018 16:19:33 +0200 Subject: [PATCH 1/5] Remove | separators --- docs/en/index.rst | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index 90b9a24eaf..d3f032f0ce 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -18,57 +18,57 @@ Doctrine MongoDB ODM don't panic. You can get help from different sources: Getting Started --------------- - :doc:`Getting Started ` | - :doc:`Introduction ` | + :doc:`Getting Started ` + :doc:`Introduction ` :doc:`Architecture ` Mapping Objects onto a Database ------------------------------- * **Basic Reference**: - :doc:`Objects and Fields ` | - :doc:`References ` | - :doc:`Bi-Directional References ` | - :doc:`Complex References ` | - :doc:`Indexes ` | + :doc:`Objects and Fields ` + :doc:`References ` + :doc:`Bi-Directional References ` + :doc:`Complex References ` + :doc:`Indexes ` :doc:`Inheritance ` * **Embedded Data**: - :doc:`Embedded ` | + :doc:`Embedded ` :doc:`Trees ` * **GridFS**: :doc:`Storing Files in GridFS ` * **Mapping Driver References**: - :doc:`XML ` | - :doc:`YAML ` | - :doc:`Docblock Annotations ` | + :doc:`XML ` + :doc:`YAML ` + :doc:`Docblock Annotations ` :doc:`Metadata Drivers ` Working with Objects -------------------- * **Basic Reference**: - :doc:`Documents ` | - :doc:`Events ` | + :doc:`Documents ` + :doc:`Events ` :doc:`Migrations ` * **Query Reference**: - :doc:`Query Builder API ` | - :doc:`Geo Spatial Queries ` | - :doc:`Slave Okay Queries ` | - :doc:`Find and Update ` | - :doc:`Filters ` | - :doc:`Priming References ` | - :doc:`Eager Cursors ` | + :doc:`Query Builder API ` + :doc:`Geo Spatial Queries ` + :doc:`Slave Okay Queries ` + :doc:`Find and Update ` + :doc:`Filters ` + :doc:`Priming References ` + :doc:`Eager Cursors ` :doc:`Map Reduce ` Advanced Topics --------------- * **Collections** - :doc:`Capped Collections ` | + :doc:`Capped Collections ` :doc:`Collection Strategies ` * **Best Practices**: @@ -84,17 +84,17 @@ Cookbook -------- * **Examples**: - :doc:`Soft Delete ` | + :doc:`Soft Delete ` :doc:`Simple Search Engine ` * **Tricks**: - :doc:`Blending ORM and MongoDB ODM ` | + :doc:`Blending ORM and MongoDB ODM ` :doc:`Mapping classes to ORM and ODM ` * **Implementation**: - :doc:`Array Access ` | - :doc:`Notify ChangeTracking Example ` | - :doc:`Using Wakeup Or Clone ` | - :doc:`Validation ` | - :doc:`Simple Search Engine ` | + :doc:`Array Access ` + :doc:`Notify ChangeTracking Example ` + :doc:`Using Wakeup Or Clone ` + :doc:`Validation ` + :doc:`Simple Search Engine ` :doc:`Keeping Your Modules Independent ` From e2cae9581d3c82c85b1256f6a1fca3705eb3ca5e Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Tue, 10 Apr 2018 16:24:08 +0200 Subject: [PATCH 2/5] Remove | separators --- docs/en/index.rst | 60 +++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index aa0b7ea048..fae30bfa6a 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -18,59 +18,59 @@ Doctrine MongoDB ODM don't panic. You can get help from different sources: Getting Started --------------- - :doc:`Getting Started ` | - :doc:`Introduction ` | + :doc:`Getting Started ` + :doc:`Introduction ` :doc:`Architecture ` Mapping Objects onto a Database ------------------------------- * **Basic Reference**: - :doc:`Objects and Fields ` | - :doc:`References ` | - :doc:`Bi-Directional References ` | - :doc:`Complex References ` | - :doc:`Indexes ` | + :doc:`Objects and Fields ` + :doc:`References ` + :doc:`Bi-Directional References ` + :doc:`Complex References ` + :doc:`Indexes ` :doc:`Inheritance ` * **Embedded Data**: - :doc:`Embedded ` | + :doc:`Embedded ` :doc:`Trees ` * **GridFS**: :doc:`Storing Files in GridFS ` * **Mapping Driver References**: - :doc:`XML ` | - :doc:`YAML ` | - :doc:`Docblock Annotations ` | + :doc:`XML ` + :doc:`YAML ` + :doc:`Docblock Annotations ` :doc:`Metadata Drivers ` Working with Objects -------------------- * **Basic Reference**: - :doc:`Documents ` | - :doc:`Events ` | + :doc:`Documents ` + :doc:`Events ` :doc:`Migrations ` * **Query Reference**: - :doc:`Query Builder API ` | - :doc:`Geo Spatial Queries ` | - :doc:`Slave Okay Queries ` | - :doc:`Find and Update ` | - :doc:`Filters ` | - :doc:`Priming References ` | - :doc:`Eager Cursors ` | + :doc:`Query Builder API ` + :doc:`Geo Spatial Queries ` + :doc:`Slave Okay Queries ` + :doc:`Find and Update ` + :doc:`Filters ` + :doc:`Priming References ` + :doc:`Eager Cursors ` :doc:`Map Reduce ` Advanced Topics --------------- * **Collections**: - :doc:`Capped Collections ` | - :doc:`Storage Strategies ` | - :doc:`Custom Collections ` | + :doc:`Capped Collections ` + :doc:`Storage Strategies ` + :doc:`Custom Collections ` :doc:`Sharded setups ` * **Best Practices**: @@ -86,17 +86,17 @@ Cookbook -------- * **Examples**: - :doc:`Soft Delete ` | + :doc:`Soft Delete ` :doc:`Simple Search Engine ` * **Tricks**: - :doc:`Blending ORM and MongoDB ODM ` | + :doc:`Blending ORM and MongoDB ODM ` :doc:`Mapping classes to ORM and ODM ` * **Implementation**: - :doc:`Array Access ` | - :doc:`Notify ChangeTracking Example ` | - :doc:`Using Wakeup Or Clone ` | - :doc:`Validation ` | - :doc:`Simple Search Engine ` | + :doc:`Array Access ` + :doc:`Notify ChangeTracking Example ` + :doc:`Using Wakeup Or Clone ` + :doc:`Validation ` + :doc:`Simple Search Engine ` :doc:`Keeping Your Modules Independent ` From b7d8504c230bffc277bfa632bb061a7d1f2ef0ff Mon Sep 17 00:00:00 2001 From: Thomas Rieschl Date: Wed, 12 Jun 2019 14:21:41 +0200 Subject: [PATCH 3/5] relax naming rule for index key name --- doctrine-mongo-mapping.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctrine-mongo-mapping.xsd b/doctrine-mongo-mapping.xsd index d735643fb8..3a2911c744 100644 --- a/doctrine-mongo-mapping.xsd +++ b/doctrine-mongo-mapping.xsd @@ -328,7 +328,7 @@ - + From dd00d8a14e1995fe5195b6b949dcd7aee0e3de6e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 25 Jun 2019 11:11:14 -0400 Subject: [PATCH 4/5] Fix `order` syntax for YAML index examples The order syntax is only relevant for single-field indexes, where the index is specified within a field mapping. Multi-field indexes should simply specify the ordering (e.g. "asc") as a value for the corresponding key. --- docs/en/reference/indexes.rst | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/en/reference/indexes.rst b/docs/en/reference/indexes.rst index 500e5dc26b..1d6ba4f340 100644 --- a/docs/en/reference/indexes.rst +++ b/docs/en/reference/indexes.rst @@ -136,7 +136,7 @@ For your convenience you can quickly specify a unique index with fields: username: unique: true - order: true + order: asc If you want to specify an index that consists of multiple fields you can specify them on the class doc block: @@ -191,10 +191,8 @@ you can specify them on the class doc block: options: unique: true keys: - accountId: - order: asc - username: - order: asc + accountId: asc + username: asc To specify multiple indexes you must use the ``@Indexes`` annotation: @@ -249,12 +247,10 @@ annotation: indexes: accountId: keys: - accountId: - order: asc + accountId: asc username: keys: - username: - order: asc + username: asc Embedded Indexes ---------------- From ee0543d4c5b1f94951ecd1e5ef366bf5915fab68 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 11 Jul 2019 07:44:25 +0200 Subject: [PATCH 5/5] Fix ReplaceRoot aggregation stage tests Since the upstream library was fixed, we need to adapt the tests to ensure they won't randomly fail. --- composer.json | 2 +- .../MongoDB/Tests/Aggregation/BuilderTest.php | 8 ++++++-- .../Tests/Aggregation/Stage/ReplaceRootTest.php | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index d2b0cc7401..3b4c7c6323 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "doctrine/cache": "~1.0", "doctrine/inflector": "~1.0", "doctrine/instantiator": "^1.0.1", - "doctrine/mongodb": "^1.6.3" + "doctrine/mongodb": "^1.6.4" }, "require-dev": { "phpunit/phpunit": "^5.7.21|^6.4", diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/BuilderTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/BuilderTest.php index 0742803c2e..1e3b44374b 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/BuilderTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/BuilderTest.php @@ -70,7 +70,11 @@ public function testPipelineConvertsTypes() ], [ '$replaceRoot' => [ - 'isToday' => ['$eq' => ['$createdAt', new \MongoDate($dateTime->format('U'), $dateTime->format('u'))]], + 'newRoot' => (object) [ + 'isToday' => [ + '$eq' => ['$createdAt', new \MongoDate($dateTime->format('U'), $dateTime->format('u'))] + ], + ], ] ] ]; @@ -105,7 +109,7 @@ public function testFieldNameConversion() '$sort' => ['ip' => 1], ], [ - '$replaceRoot' => '$ip', + '$replaceRoot' => ['newRoot' => '$ip'], ] ]; diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/ReplaceRootTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/ReplaceRootTest.php index 07e4a6824a..dfefcb4228 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/ReplaceRootTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/ReplaceRootTest.php @@ -20,7 +20,9 @@ public function testTypeConversion() $this->assertEquals( ['$replaceRoot' => [ - 'isToday' => ['$eq' => ['$createdAt', $mongoDate]], + 'newRoot' => (object) [ + 'isToday' => ['$eq' => ['$createdAt', $mongoDate]], + ], ]], $stage->getExpression() ); @@ -41,7 +43,9 @@ public function testTypeConversionWithDirectExpression() $this->assertEquals( ['$replaceRoot' => [ - 'isToday' => ['$eq' => ['$createdAt', $mongoDate]], + 'newRoot' => (object) [ + 'isToday' => ['$eq' => ['$createdAt', $mongoDate]], + ], ]], $stage->getExpression() ); @@ -58,7 +62,9 @@ public function testFieldNameConversion() $this->assertEquals( ['$replaceRoot' => [ - 'someField' => ['$concat' => ['$ip', 'foo']], + 'newRoot' => (object) [ + 'someField' => ['$concat' => ['$ip', 'foo']], + ], ]], $stage->getExpression() ); @@ -72,7 +78,9 @@ public function testFieldNameConversionWithDirectExpression() ->replaceRoot('$authorIp'); $this->assertEquals( - ['$replaceRoot' => '$ip'], + [ + '$replaceRoot' => ['newRoot' => '$ip'], + ], $stage->getExpression() ); }