From 600e90ea96f4c50a62baa1b3110a757073df9cc5 Mon Sep 17 00:00:00 2001 From: evanchooly Date: Mon, 23 Nov 2026 13:14:04 -0500 Subject: [PATCH] Convert the legacy cases whose pages print results the server does not return A ledger entry can carry a reviewed page error that skips only the published check, keeping serialization and behavior strict. Nine cases convert that way, each with the evidence: printed field orders the server does not return, a Long printed as a plain number, and facets printed out of the pipeline's order. The $addToSet and $setUnion cases declare their set arrays unordered instead, so all their checks stay strict. Five legacy cases remain. --- audits/README.md | 6 +- audits/catalog/cutover.json | 44 - audits/catalog/fixture-migration.json | 673 +++++++++++++++ audits/catalog/form-migration.json | 54 +- audits/catalog/form-review.json | 54 +- audits/catalog/legacy-references.json | 6 +- .../dev/morphia/audits/generate/Candidates.kt | 3 +- .../audits/repairs/FixtureMigration.kt | 34 +- .../audits/offline/FixtureMigrationTest.kt | 7 +- .../audits/offline/FormMigrationTest.kt | 2 +- .../dev/morphia/test/OperatorCaseRunner.java | 6 +- .../addToSet/useInGroupStage/action.json | 7 - .../addToSet/useInGroupStage/data.json | 5 - .../addToSet/useInGroupStage/expected.json | 3 - .../expressions/addToSet/useInGroupStage/name | 1 - .../addToSet/useInGroupStage/scenario.json | 260 ++++++ .../cos/cosineOfValueInDegrees/action.json | 10 - .../cos/cosineOfValueInDegrees/data.json | 1 - .../cos/cosineOfValueInDegrees/expected.json | 1 - .../cos/cosineOfValueInDegrees/name | 1 - .../cos/cosineOfValueInDegrees/scenario.json | 98 +++ .../cos/cosineOfValueInRadians/action.json | 10 - .../cos/cosineOfValueInRadians/data.json | 1 - .../cos/cosineOfValueInRadians/expected.json | 1 - .../cos/cosineOfValueInRadians/name | 1 - .../cos/cosineOfValueInRadians/scenario.json | 96 +++ .../queryFieldsThatContainPeriods/action.json | 6 - .../queryFieldsThatContainPeriods/data.json | 5 - .../expected.json | 2 - .../queryFieldsThatContainPeriods/name | 1 - .../scenario.json | 185 +++++ .../action.json | 6 - .../data.json | 5 - .../expected.json | 2 - .../queryFieldsThatStartWithADollarSign/name | 1 - .../scenario.json | 187 +++++ .../isoWeekYearExpressionOperator/action.json | 5 - .../isoWeekYearExpressionOperator/data.json | 4 - .../expected.json | 4 - .../isoWeekYearExpressionOperator/name | 1 - .../scenario.json | 170 ++++ .../setUnionAccumulatorOperator/action.json | 12 - .../setUnionAccumulatorOperator/data.json | 9 - .../setUnionAccumulatorOperator/expected.json | 9 - .../setUnion/setUnionAccumulatorOperator/name | 1 - .../setUnionAccumulatorOperator/scenario.json | 570 +++++++++++++ .../sin/sineOfValueInDegrees/action.json | 10 - .../sin/sineOfValueInDegrees/data.json | 1 - .../sin/sineOfValueInDegrees/expected.json | 1 - .../expressions/sin/sineOfValueInDegrees/name | 1 - .../sin/sineOfValueInDegrees/scenario.json | 98 +++ .../sin/sineOfValueInRadians/action.json | 10 - .../sin/sineOfValueInRadians/data.json | 1 - .../sin/sineOfValueInRadians/expected.json | 1 - .../expressions/sin/sineOfValueInRadians/name | 1 - .../sin/sineOfValueInRadians/scenario.json | 96 +++ .../multiFacetedAggregation/action.json | 38 - .../multiFacetedAggregation/data.json | 8 - .../multiFacetedAggregation/expected.json | 1 - .../bucketAuto/multiFacetedAggregation/name | 1 - .../multiFacetedAggregation/scenario.json | 767 ++++++++++++++++++ .../action.json | 40 - .../data.json | 8 - .../expected.json | 1 - .../multiFacetedAggregationAsPipeline/name | 1 - .../scenario.json | 767 ++++++++++++++++++ .../dev/morphia/test/generated/manifest.json | 99 +++ design/operator-audits-design.md | 2 +- design/operator-audits-progress.md | 24 +- 69 files changed, 4168 insertions(+), 379 deletions(-) delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/name create mode 100644 core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json diff --git a/audits/README.md b/audits/README.md index 755d4d90f6f..590b09343a1 100644 --- a/audits/README.md +++ b/audits/README.md @@ -169,9 +169,9 @@ These remain because coverage has not fully moved off them yet. Each one goes wh its users does. - **Core's legacy fixture loader** (`data.json`, `action.json`, `expected.json` through - `TemplatedTestBase`). It runs 16 legacy fixture directories, each with a documented source: - 15 tracked as legacy-only in `cutover.json` with the strict check they fail, and one declaration - that needs alternative commands. 373 cases have moved to the runner; the 167 legacy tests whose + `TemplatedTestBase`). It runs 5 legacy fixture directories, each with a documented source: 4 + tracked as legacy-only in `cutover.json` with the strict check they fail, and one declaration + that needs alternative commands. 384 cases have moved to the runner; the 167 legacy tests whose fixtures no documented source reproduced were deleted and are recorded in `audits/catalog/deleted-fixtures.json`. - **The legacy RST extractor** (`rst/`, `model/CodeBlock`). Cutover and the example inventory diff --git a/audits/catalog/cutover.json b/audits/catalog/cutover.json index adfbaa26b22..4465e58c7d1 100644 --- a/audits/catalog/cutover.json +++ b/audits/catalog/cutover.json @@ -1,53 +1,9 @@ { "contexts" : [ "aggregation/expressions", "aggregation/stages", "query" ], "legacyOnly" : [ { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /1: no result matches this constraint", - "fixture" : "aggregation/expressions/addToSet/useInGroupStage" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: key order differs", - "fixture" : "aggregation/expressions/cos/cosineOfValueInDegrees" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: key order differs", - "fixture" : "aggregation/expressions/cos/cosineOfValueInRadians" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: key order differs", - "fixture" : "aggregation/expressions/getField/queryFieldsThatContainPeriods" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: key order differs", - "fixture" : "aggregation/expressions/getField/queryFieldsThatStartWithADollarSign" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0/yearNumber: printed whole 2015 is an Int64 2015", - "fixture" : "aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /2: no result matches this constraint", - "fixture" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: key order differs", - "fixture" : "aggregation/expressions/sin/sineOfValueInDegrees" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: key order differs", - "fixture" : "aggregation/expressions/sin/sineOfValueInRadians" - }, { "check" : "SOURCE", "detail" : "the shell normalizer cannot read the documented results (expected syntax)", "fixture" : "aggregation/expressions/tan/tangentOfValueInRadians" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: no result matches this constraint", - "fixture" : "aggregation/stages/bucketAuto/multiFacetedAggregation" - }, { - "check" : "PUBLISHED", - "detail" : "results differ from the printed results at /0: no result matches this constraint", - "fixture" : "aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline" }, { "check" : "SOURCE", "detail" : "the shell normalizer cannot read the documented results (expected syntax)", diff --git a/audits/catalog/fixture-migration.json b/audits/catalog/fixture-migration.json index 48bbe745719..101b53e2775 100644 --- a/audits/catalog/fixture-migration.json +++ b/audits/catalog/fixture-migration.json @@ -352,6 +352,79 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/add/addNumbers/scenario.json", "scenarioSha256" : "1a7c2c3e8e6ad1f9ccbe6d55847da58dfe4604d7afeb47cfe8cc99c359f4f340", "test" : "dev.morphia.test.aggregation.expressions.TestAdd#testAddNumbers" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "0fb2423a313345faeebf6b7a0a46a169fc1a4e3cb13e5a760b3d6bfa7b1112e4", + "data.json" : "c19398725980cdd99aabf629d09644b8e953313e79555e0a795c333dceccc327", + "expected.json" : "9929e0280aa20f0339d883545880d68df60ebc2c191b2820ba486994fead111e", + "name" : "13f25f9e86f0b9e61fadd6bf4b7abfb86a1c10d3a115219d3922ae7660f13653" + }, + "fixture" : "aggregation/expressions/addToSet/useInGroupStage", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline(new ActionTestOptions().orderMatters(false),\n aggregation -> aggregation\n .pipeline(group(Group.id().field(\"day\", dayOfYear(\"$date\")).field(\"year\", year(\"$date\")))\n .field(\"itemsSold\", addToSet(\"$item\")))\n\n );\n\n }", + "legacyBodySha256" : "531e3d7ac0eaa526aeb333f512cfecaeb1dec13a7556574242222f87e1b981ce", + "legacyMethod" : "testUseInGroupStage", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestAddToSet", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "a1fcd8e461b05a7f59d09ca1943f6e781fd57e0a50253baeaa352a011ecfca54", + "text" : "db.sales.aggregate(\n [\n {\n $group:\n {\n _id: { day: { $dayOfYear: \"$date\"}, year: { $year: \"$date\" } },\n itemsSold: { $addToSet: \"$item\" }\n }\n }\n ]\n)" + }, { + "role" : "DATA", + "sha256" : "7614839fbd529c06670e8e40d19c6d9256ca6ad01eba4426869a8ad4c8bf3930", + "text" : "{ \"_id\" : 1, \"item\" : \"abc\", \"price\" : 10, \"quantity\" : 2, \"date\" : ISODate(\"2014-01-01T08:00:00Z\") }\n{ \"_id\" : 2, \"item\" : \"jkl\", \"price\" : 20, \"quantity\" : 1, \"date\" : ISODate(\"2014-02-03T09:00:00Z\") }\n{ \"_id\" : 3, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 5, \"date\" : ISODate(\"2014-02-03T09:05:00Z\") }\n{ \"_id\" : 4, \"item\" : \"abc\", \"price\" : 10, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T08:00:00Z\") }\n{ \"_id\" : 5, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T09:12:00Z\") }" + }, { + "role" : "EXPECTED", + "sha256" : "9929e0280aa20f0339d883545880d68df60ebc2c191b2820ba486994fead111e", + "text" : "{ \"_id\" : { \"day\" : 46, \"year\" : 2014 }, \"itemsSold\" : [ \"xyz\", \"abc\" ] }\n{ \"_id\" : { \"day\" : 34, \"year\" : 2014 }, \"itemsSold\" : [ \"xyz\", \"jkl\" ] }\n{ \"_id\" : { \"day\" : 1, \"year\" : 2014 }, \"itemsSold\" : [ \"abc\" ] }" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Use in ``$group`` Stage", + "fixture" : "aggregation/expressions/addToSet/useInGroupStage", + "fixtureFiles" : { + "action.json" : "0fb2423a313345faeebf6b7a0a46a169fc1a4e3cb13e5a760b3d6bfa7b1112e4", + "data.json" : "c19398725980cdd99aabf629d09644b8e953313e79555e0a795c333dceccc327", + "expected.json" : "9929e0280aa20f0339d883545880d68df60ebc2c191b2820ba486994fead111e", + "name" : "13f25f9e86f0b9e61fadd6bf4b7abfb86a1c10d3a115219d3922ae7660f13653" + }, + "includes" : [ { + "blob" : "48429813c7e668caccccfe27b3b2894cd4d066e7", + "path" : "source/includes/extracts-fact-aggregation-accumulator.yaml" + }, { + "blob" : "e2dda4a385450130f3ca31944a8c58804e80ce6d", + "path" : "source/includes/extracts-fact-aggregation-accumulator-base.yaml" + }, { + "blob" : "f56012674985fd6d9fe5f558a661d55d6a717156", + "path" : "source/includes/setWindowFields-example-collection.rst" + }, { + "blob" : "13694f7d606928cb63fd6b471d29c52c8a6e7f40", + "path" : "source/includes/setWindowFields-partition-sort-date.rst" + } ], + "origin" : "4774dcba942556fdc81d25c2d94c18e3173ab505", + "pageBlob" : "3eab8a0f74fa1ac382290e0d2b593ef2c2c0dbef", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "d84aad6501cde0bf6dcb41c1ce9bddbabc8e3acb", + "path" : "source/reference/operator/aggregation/addToSet.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ], + "unorderedArrays" : [ { + "path" : "/itemsSold", + "reason" : "$addToSet does not order the array it builds: the server lists the set's members in a different order between runs on identical data, and the page prints one order" + } ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json", + "scenarioSha256" : "56903351e0d1dc2c8346a6e2bee4cbbd6861f189ccd597a37fdca95de360316e", + "test" : "dev.morphia.test.aggregation.expressions.TestAddToSet#testUseInGroupStage" }, { "bodyEdit" : null, "files" : { @@ -2310,6 +2383,122 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/cond/condExpressionOperator/scenario.json", "scenarioSha256" : "db6dfe2a12f2a75851d0c6e3ccf4f4d137adb5daca4e6f182caf2f0a9cf39dca", "test" : "dev.morphia.test.aggregation.expressions.TestCond#testCondExpressionOperator" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "ab5f365b29a1254d0efbf5614f4c977aaf1760221c4618d9b82cc8c91568a799", + "data.json" : "d18629229503cd4d4bb17a530d96977314da5532ed8b817c84dc20c220d1b4f5", + "expected.json" : "28e338d19a80b5c69b4835aabc9cc25db4a53a636cd6a61aee3bd7e2c088aafa", + "name" : "e05a8bf1ab70db982ae5ae4f04f6c889c3e1798184b8df27399971e1781e0487" + }, + "fixture" : "aggregation/expressions/cos/cosineOfValueInDegrees", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation\n .pipeline(addFields().field(\"side_a\", multiply(cos(degreesToRadians(\"$angle_a\")), \"$hypotenuse\"))));\n }", + "legacyBodySha256" : "66fe7ee13a479ad6a7a4f8731ad2cef57a2ec665f9436f3d96fb9146d58b72ee", + "legacyMethod" : "testCosineOfValueInDegrees", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestCos", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "db06080419614dcb6e1f12209a210387ad34f477fc0cac625fe8a68bb12c1b30", + "text" : "db.trigonometry.aggregate([\n {\n $addFields : {\n \"side_a\" : {\n $multiply : [\n { $cos : {$degreesToRadians : \"$angle_a\"} },\n \"$hypotenuse\"\n ]\n }\n }\n }\n])" + }, { + "role" : "DATA", + "sha256" : "773c20efb8ac7f22d9fe63669ff0a97a9612012db10916e18028913ad0e4f776", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"53.13010235415597870314438744090659\"),\n \"hypotenuse\" : NumberDecimal(\"5\")\n}" + }, { + "role" : "EXPECTED", + "sha256" : "3657c57fc88c7654eabf41069a623dfdd6dd9857fb0d4ddbf72753788b5c187f", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"53.13010235415597870314438744090659\"),\n \"side_a\" : NumberDecimal(\"2.999999999999999999999999999999999\"),\n \"hypotenuse\" : NumberDecimal(\"5\"),\n}" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "main :: Cosine of Value in Degrees", + "fixture" : "aggregation/expressions/cos/cosineOfValueInDegrees", + "fixtureFiles" : { + "action.json" : "ab5f365b29a1254d0efbf5614f4c977aaf1760221c4618d9b82cc8c91568a799", + "data.json" : "d18629229503cd4d4bb17a530d96977314da5532ed8b817c84dc20c220d1b4f5", + "expected.json" : "28e338d19a80b5c69b4835aabc9cc25db4a53a636cd6a61aee3bd7e2c088aafa", + "name" : "e05a8bf1ab70db982ae5ae4f04f6c889c3e1798184b8df27399971e1781e0487" + }, + "includes" : [ ], + "origin" : "948049a3364491f4905246224922d2dbb4197154", + "pageBlob" : "fea873bacbd276ce279f34a83646e17aa7a28a5e", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "8562c94b38de3e8c83552bcd41558548e5220eef", + "path" : "source/reference/operator/aggregation/cos.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json", + "scenarioSha256" : "4a989c56ad10af1e05c469e24af37a9805a1dac319d5ea750cf82254f1f75d0b", + "test" : "dev.morphia.test.aggregation.expressions.TestCos#testCosineOfValueInDegrees" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "542d1ef04ff4b96b8dd4d6fe56cc431d3ca0bf4a065af9dacf5d49b6b7a10747", + "data.json" : "6f563aefefe5aa801f68cd9b63f15dcb642d097b3c464591ead97d15e2ec92c4", + "expected.json" : "ede8927437868fb2020467af8f4c18c626c08b2e30d614ed162eaab57f77ed61", + "name" : "da9237a4a6aa2a0a0d3fd5e4ed90d189ba07bc740834b29c85035a3e0d303cb1" + }, + "fixture" : "aggregation/expressions/cos/cosineOfValueInRadians", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation\n .pipeline(addFields().field(\"side_b\", multiply(cos(\"$angle_a\"), \"$hypotenuse\"))));\n }", + "legacyBodySha256" : "f64cb59ff9cd5e7e6005f45ae68ea8cbc7dee19a2ba67a5eb1d61af6cf47c3f8", + "legacyMethod" : "testCosineOfValueInRadians", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestCos", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "45ffefddde672984544b6e9bf59d81f0ed00c7f5c9395fcbfd2675b3a82431d3", + "text" : "db.trigonometry.aggregate([\n {\n $addFields : {\n \"side_b\" : {\n $multiply : [\n { $cos : \"$angle_a\" },\n \"$hypotenuse\"\n ]\n }\n }\n }\n])" + }, { + "role" : "DATA", + "sha256" : "3617967fbf8dd3294f1ef06f3a93369c25d15f7136bab6f29f1773244f0981cf", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"0.9272952180016122324285124629224288\"),\n \"hypotenuse\" : NumberDecimal(\"5\")\n}" + }, { + "role" : "EXPECTED", + "sha256" : "f087d524c5ffc180e48d4380751a56c097e33032397dcb390855b83242295a9e", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"0.9272952180016122324285124629224288\"),\n \"side_b\" : NumberDecimal(\"3.000000000000000000000000000000000\"),\n \"hypotenuse\" : NumberDecimal(\"5\"),\n}" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "main :: Cosine of Value in Radians", + "fixture" : "aggregation/expressions/cos/cosineOfValueInRadians", + "fixtureFiles" : { + "action.json" : "542d1ef04ff4b96b8dd4d6fe56cc431d3ca0bf4a065af9dacf5d49b6b7a10747", + "data.json" : "6f563aefefe5aa801f68cd9b63f15dcb642d097b3c464591ead97d15e2ec92c4", + "expected.json" : "ede8927437868fb2020467af8f4c18c626c08b2e30d614ed162eaab57f77ed61", + "name" : "da9237a4a6aa2a0a0d3fd5e4ed90d189ba07bc740834b29c85035a3e0d303cb1" + }, + "includes" : [ ], + "origin" : "3ed9dc5c1fb30de5717e0d52d8b63a1f7a17bf8d", + "pageBlob" : "fea873bacbd276ce279f34a83646e17aa7a28a5e", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "8562c94b38de3e8c83552bcd41558548e5220eef", + "path" : "source/reference/operator/aggregation/cos.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json", + "scenarioSha256" : "0456d40920e835632f5e721daae74e3f70440bb73a99e124a59df0abfacf2768", + "test" : "dev.morphia.test.aggregation.expressions.TestCos#testCosineOfValueInRadians" }, { "bodyEdit" : null, "files" : { @@ -4846,6 +5035,122 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryAFieldInASubDocument/scenario.json", "scenarioSha256" : "4e4f13cc79539a1ddc3017b0e2c91dff1e1cf957611aa15afef1386b722d85d9", "test" : "dev.morphia.test.aggregation.expressions.TestGetField#testQueryAFieldInASubDocument" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "d3ccd632b34ba8890fa1fb522616bacc6f87af53ab8a60244d35e45b091b663e", + "data.json" : "49f80fa8d558ba3b208a4cc6e8ef4fa9b24aca9c9fbf6259a12f10a449a874f7", + "expected.json" : "3dbf65cc94f2e60d099fa0c3c0bd744eb654a71509d1180cba8cbef600eb8477", + "name" : "8fc0f79074054bd9852e9a8cfe6e2ff4c69d2828cf0b1b4358611127bc4442e0" + }, + "fixture" : "aggregation/expressions/getField/queryFieldsThatContainPeriods", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation.pipeline(match(expr(gt(getField(\"price.usd\"), 200)))));\n }", + "legacyBodySha256" : "cd1b9c48f4a821fffc7bf1776623d97ace35730838f2ff4fb29283615babbf78", + "legacyMethod" : "testQueryFieldsThatContainPeriods", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestGetField", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "ed39af0db62e1b58c0aeee80ac735f333fc8f83a19199220c5c5e7c57aadf491", + "text" : "db.inventory.aggregate( [\n {\n $match: \n { $expr: \n { $gt: [ { $getField: \"price.usd\" }, 200 ] }\n }\n }\n] )" + }, { + "role" : "DATA", + "sha256" : "c1fb6a8c39dd362bc5dca28f3de2ee2f6f0af106642aab37b5610c95fb7becd1", + "text" : "{ \"_id\" : 1, \"item\" : \"sweatshirt\", \"price.usd\": 45.99, qty: 300 }\n{ \"_id\" : 2, \"item\" : \"winter coat\", \"price.usd\": 499.99, qty: 200 }\n{ \"_id\" : 3, \"item\" : \"sun dress\", \"price.usd\": 199.99, qty: 250 }\n{ \"_id\" : 4, \"item\" : \"leather boots\", \"price.usd\": 249.99, qty: 300 }\n{ \"_id\" : 5, \"item\" : \"bow tie\", \"price.usd\": 9.99, qty: 180 }" + }, { + "role" : "EXPECTED", + "sha256" : "759bba96e9bcdc434d9021c8c2ef6dc040e4d7c62e28155cf823854b5ee38e70", + "text" : "[\n { _id: 2, item: 'winter coat', qty: 200, 'price.usd': 499.99 },\n { _id: 4, item: 'leather boots', qty: 300, 'price.usd': 249.99 }\n]" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Query Fields that Contain Periods (``.``)", + "fixture" : "aggregation/expressions/getField/queryFieldsThatContainPeriods", + "fixtureFiles" : { + "action.json" : "d3ccd632b34ba8890fa1fb522616bacc6f87af53ab8a60244d35e45b091b663e", + "data.json" : "49f80fa8d558ba3b208a4cc6e8ef4fa9b24aca9c9fbf6259a12f10a449a874f7", + "expected.json" : "3dbf65cc94f2e60d099fa0c3c0bd744eb654a71509d1180cba8cbef600eb8477", + "name" : "8fc0f79074054bd9852e9a8cfe6e2ff4c69d2828cf0b1b4358611127bc4442e0" + }, + "includes" : [ ], + "origin" : "69a77e75d9e3c922bdfa45ecfa59dac3f98ac7c7", + "pageBlob" : "899c62457ce159b0bf99eecaef4b51ca30ab7d24", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "111836fb23076857f0cf9bcce15e694fe4a169e4", + "path" : "source/reference/operator/aggregation/getField.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints qty before price.usd; the server returns the fields in the order the page's own insert stores them; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json", + "scenarioSha256" : "22c7c116b72d0256245f63016d59740d3be0366b3e94a7f27e8ee2a96f592b35", + "test" : "dev.morphia.test.aggregation.expressions.TestGetField#testQueryFieldsThatContainPeriods" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "a153316785de3b31d4236ab6d63a78d9e4c69ffdd270a2f18d922cfe22708796", + "data.json" : "1aef2ddf0809a3b16a6a9028ca9f30385d5d2e5e7cb6abfd4804633e1c95d829", + "expected.json" : "e5b336f97f3a03cac65dd8ab49f91913b4c59693ac45bc731eb7189872d9d024", + "name" : "37c029e4e2f53583e4a100aeb6e45a1500655504b17a782dbfe56a01e6d427f3" + }, + "fixture" : "aggregation/expressions/getField/queryFieldsThatStartWithADollarSign", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation.pipeline(match(expr(gt(getField(literal(\"$price\")), 200)))));\n }", + "legacyBodySha256" : "2b73f77a9bd70e675c948b23b5909ccb71771441b7708da157eee649c964aa6a", + "legacyMethod" : "testQueryFieldsThatStartWithADollarSign", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestGetField", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "926293f8f6e7bf0937fd479be7e8e498da075dbeb38dfa162a3e810a7ef12990", + "text" : "db.inventory.aggregate( [\n {\n $match: \n { $expr: \n { $gt: [ { $getField: {$literal: \"$price\" } }, 200 ] }\n }\n }\n] )" + }, { + "role" : "DATA", + "sha256" : "8d4efdde9f4a8349d09674f34906394284ec75aa10ea497c68cdb36e5b0928ad", + "text" : "{ \"_id\" : 1, \"item\" : \"sweatshirt\", \"$price\": 45.99, qty: 300 }\n{ \"_id\" : 2, \"item\" : \"winter coat\", \"$price\": 499.99, qty: 200 }\n{ \"_id\" : 3, \"item\" : \"sun dress\", \"$price\": 199.99, qty: 250 }\n{ \"_id\" : 4, \"item\" : \"leather boots\", \"$price\": 249.99, qty: 300 }\n{ \"_id\" : 5, \"item\" : \"bow tie\", \"$price\": 9.99, qty: 180 }" + }, { + "role" : "EXPECTED", + "sha256" : "43659b6742fd31da4d83cf0c8acc93987188d98f9ced3b3106817c1f0960a5b5", + "text" : "[\n { _id: 2, item: 'winter coat', qty: 200, '$price': 499.99 },\n { _id: 4, item: 'leather boots', qty: 300, '$price': 249.99 }\n]" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Query Fields that Start with a Dollar Sign (``$``)", + "fixture" : "aggregation/expressions/getField/queryFieldsThatStartWithADollarSign", + "fixtureFiles" : { + "action.json" : "a153316785de3b31d4236ab6d63a78d9e4c69ffdd270a2f18d922cfe22708796", + "data.json" : "1aef2ddf0809a3b16a6a9028ca9f30385d5d2e5e7cb6abfd4804633e1c95d829", + "expected.json" : "e5b336f97f3a03cac65dd8ab49f91913b4c59693ac45bc731eb7189872d9d024", + "name" : "37c029e4e2f53583e4a100aeb6e45a1500655504b17a782dbfe56a01e6d427f3" + }, + "includes" : [ ], + "origin" : "69a77e75d9e3c922bdfa45ecfa59dac3f98ac7c7", + "pageBlob" : "899c62457ce159b0bf99eecaef4b51ca30ab7d24", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "111836fb23076857f0cf9bcce15e694fe4a169e4", + "path" : "source/reference/operator/aggregation/getField.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the fields in an order other than the one its own insert stores them in, which the server returns; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json", + "scenarioSha256" : "81af7013819861d875108a8370dcb305faa23e81146ed7e5d0b3cac09bbb2c70", + "test" : "dev.morphia.test.aggregation.expressions.TestGetField#testQueryFieldsThatStartWithADollarSign" }, { "bodyEdit" : null, "files" : { @@ -5556,6 +5861,67 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeek/isoWeekExpressionOperator/scenario.json", "scenarioSha256" : "321c11e7e6ff0827f0bdf124c01f3db4c075efa5b9c5f45447c3758e06d0def6", "test" : "dev.morphia.test.aggregation.expressions.TestIsoWeek#testIsoWeekExpressionOperator" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "5ffb82eb5174660e4978d51731bec650ec2729b22f2863c2db589d3e6e3eb20e", + "data.json" : "a3854ddcaea5741367b2977d939c20840a0f809d91f2a4ae8dcd464215e7f032", + "expected.json" : "cb3715f532467bc73b42db920feedf1023f2ffe09d148616bae831595553670d", + "name" : "0d6e4079e36703ebd37c00722f5891d28b0e2811dc114b129215123adcce3605" + }, + "fixture" : "aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation.pipeline(project().include(\"yearNumber\", isoWeekYear(\"$date\"))));\n }", + "legacyBodySha256" : "5e6c1e289985604c0cf0400f84c782514a2bd3b653590b8a1e65a2c5259508e3", + "legacyMethod" : "testIsoWeekYearExpressionOperator", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestIsoWeekYear", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "3e6a59b1ab1a7314bc03f53ab5185b6ef0028c74e1c1677fe1ebd0a75d39a71f", + "text" : "db.anniversaries.aggregate( [\n {\n $project: {\n yearNumber: { $isoWeekYear: \"$date\" }\n }\n }\n] )" + }, { + "role" : "DATA", + "sha256" : "a3854ddcaea5741367b2977d939c20840a0f809d91f2a4ae8dcd464215e7f032", + "text" : "{ \"_id\" : 1, \"date\" : ISODate(\"2016-01-01T00:00:00Z\") }\n{ \"_id\" : 2, \"date\" : ISODate(\"2016-01-04T00:00:00Z\") }\n{ \"_id\" : 3, \"date\" : ISODate(\"2015-01-01T00:00:00Z\") }\n{ \"_id\" : 4, \"date\" : ISODate(\"2014-04-21T00:00:00Z\") }" + }, { + "role" : "EXPECTED", + "sha256" : "cb3715f532467bc73b42db920feedf1023f2ffe09d148616bae831595553670d", + "text" : "{ \"_id\" : 1, \"yearNumber\" : 2015 }\n{ \"_id\" : 2, \"yearNumber\" : 2016 }\n{ \"_id\" : 3, \"yearNumber\" : 2015 }\n{ \"_id\" : 4, \"yearNumber\" : 2014 }" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "main", + "fixture" : "aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator", + "fixtureFiles" : { + "action.json" : "5ffb82eb5174660e4978d51731bec650ec2729b22f2863c2db589d3e6e3eb20e", + "data.json" : "a3854ddcaea5741367b2977d939c20840a0f809d91f2a4ae8dcd464215e7f032", + "expected.json" : "cb3715f532467bc73b42db920feedf1023f2ffe09d148616bae831595553670d", + "name" : "0d6e4079e36703ebd37c00722f5891d28b0e2811dc114b129215123adcce3605" + }, + "includes" : [ { + "blob" : "3a74fe28048991c6f514db876929e8939534d8ee", + "path" : "source/includes/fact-iso-date-objects.rst" + } ], + "origin" : "948049a3364491f4905246224922d2dbb4197154", + "pageBlob" : "1382e4dfb1f694eaad63993cfe3d19ab9b0a52b5", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "6560e617067dff1934063555ec97e57cad362fc8", + "path" : "source/reference/operator/aggregation/isoWeekYear.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: $isoWeekYear returns a Long, which mongosh prints as Long('2015'); the page prints 2015, which only an Int32 or a Double prints as; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json", + "scenarioSha256" : "d327648b3917ff83c74271a7ea36b5f132e12d169d9bbfd8cfadf7d049f9027a", + "test" : "dev.morphia.test.aggregation.expressions.TestIsoWeekYear#testIsoWeekYearExpressionOperator" }, { "bodyEdit" : null, "files" : { @@ -10885,6 +11251,81 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/setIsSubset/setIsSubsetExpressionOperator/scenario.json", "scenarioSha256" : "28249d4a3cb6fa2a39597236da8cc74a984c8e875db5f04c45a69fc3764d8480", "test" : "dev.morphia.test.aggregation.expressions.TestSetIsSubset#testSetIsSubsetExpressionOperator" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "58a773e31fc06aca6ece771f62acaa30b338a6c3a2e6a99c060c1bd7cc7833dd", + "data.json" : "01b6f83876510cb9f326b4cef4476f019a54cd5894b583866e11f34cdeae218a", + "expected.json" : "1512ea57843cc59b806529b1377d79f1a5b4576eae873a1ce12af6a456d87d8b", + "lock" : "e17fac3fb207733c3d2910b145f4878ecdbee2a2d8c8f7d6337bb23cd582cc6b", + "name" : "0d6e4079e36703ebd37c00722f5891d28b0e2811dc114b129215123adcce3605" + }, + "fixture" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline(new ActionTestOptions().orderMatters(false),\n (aggregation) -> aggregation.pipeline(project().suppressId().include(\"flowerFieldA\")\n .include(\"flowerFieldB\").include(\"allValues\", setUnion(\"$flowerFieldA\", \"$flowerFieldB\"))));\n }", + "legacyBodySha256" : "48a48dc3c43eb3a4171d8178a85ec01bafff4f959888b3f0490f1b90ccbf6e31", + "legacyMethod" : "testSetUnionAccumulatorOperator", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestSetUnion", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "505edb1e4bde2908694f17718f020da56a9df0140f79eab66f2d9f3d76ee0318", + "text" : "db.flowers.aggregate(\n [\n { $project: { flowerFieldA:1, flowerFieldB: 1, allValues: { $setUnion: [ \"$flowerFieldA\", \"$flowerFieldB\" ] }, _id: 0 } }\n ]\n)" + }, { + "role" : "DATA", + "sha256" : "6443ea787dad4fdfbd05b758c7838ea1b3cd69c19b2e0fe36fad50c454f6eeed", + "text" : "db.flowers.insertMany( [\n { \"_id\" : 1, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\" ] },\n { \"_id\" : 2, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"orchid\", \"rose\", \"orchid\" ] },\n { \"_id\" : 3, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\", \"jasmine\" ] },\n { \"_id\" : 4, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"jasmine\", \"rose\" ] },\n { \"_id\" : 5, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ ] },\n { \"_id\" : 6, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\" ], [ \"orchid\" ] ] },\n { \"_id\" : 7, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\", \"orchid\" ] ] },\n { \"_id\" : 8, \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ ] },\n { \"_id\" : 9, \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ \"rose\" ] }\n] ) " + }, { + "role" : "EXPECTED", + "sha256" : "1512ea57843cc59b806529b1377d79f1a5b4576eae873a1ce12af6a456d87d8b", + "text" : "{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"rose\", \"orchid\" ], \"allValues\": [ \"orchid\", \"rose\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"orchid\", \"rose\", \"orchid\" ], \"allValues\": [ \"orchid\", \"rose\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"rose\", \"orchid\", \"jasmine\" ], \"allValues\": [ \"orchid\", \"rose\", \"jasmine\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"jasmine\", \"rose\" ], \"allValues\": [ \"orchid\", \"rose\", \"jasmine\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ ], \"allValues\": [ \"orchid\", \"rose\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ [ \"rose\" ], [ \"orchid\" ] ], \"allValues\": [ \"orchid\", \"rose\", [ \"rose\" ], [ \"orchid\" ] ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ [ \"rose\", \"orchid\" ] ], \"allValues\": [ \"orchid\", \"rose\", [ \"rose\", \"orchid\" ] ] }\n{ \"flowerFieldA\": [ ], \"flowerFieldB\": [ ], \"allValues\": [ ] }\n{ \"flowerFieldA\": [ ], \"flowerFieldB\": [ \"rose\" ], \"allValues\": [ \"rose\" ] }" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "main", + "fixture" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator", + "fixtureFiles" : { + "action.json" : "58a773e31fc06aca6ece771f62acaa30b338a6c3a2e6a99c060c1bd7cc7833dd", + "data.json" : "01b6f83876510cb9f326b4cef4476f019a54cd5894b583866e11f34cdeae218a", + "expected.json" : "1512ea57843cc59b806529b1377d79f1a5b4576eae873a1ce12af6a456d87d8b", + "name" : "0d6e4079e36703ebd37c00722f5891d28b0e2811dc114b129215123adcce3605" + }, + "includes" : [ { + "blob" : "9ba8fe6005b2e4e5e7a77bbf7c6535da3355c571", + "path" : "source/includes/important-set-operator-semantics.rst" + }, { + "blob" : "3ae8bf736443eaa8cf84e56de8d30b33dd6449bc", + "path" : "source/includes/extracts-fact-agg-top-level-expressions.yaml" + }, { + "blob" : "5366b8d724f1705e143d55a10e620d6fe50b37de", + "path" : "source/includes/extracts-parent-fact-agg-top-level-expressions.yaml" + } ], + "origin" : "948049a3364491f4905246224922d2dbb4197154", + "pageBlob" : "5fb7cb7683edfc6e33c1129ce27a7d763725669c", + "retiredLock" : { + "name" : "lock", + "sha256" : "e17fac3fb207733c3d2910b145f4878ecdbee2a2d8c8f7d6337bb23cd582cc6b", + "text" : "rearrange suppress id\n" + }, + "retypes" : [ ], + "rules" : [ "PROJECT_ID_FIRST" ], + "shape" : "PIPELINE", + "source" : { + "commit" : "e0848b6ada3e691ecada5da38e717de2d2545843", + "path" : "source/reference/operator/aggregation/setUnion.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ], + "unorderedArrays" : [ { + "path" : "/allValues", + "reason" : "$setUnion does not order the array it returns: the page prints one order, and the server returns another" + } ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json", + "scenarioSha256" : "4b3a9060e0676e65686562eac67186e9e0462cd1dd1eac814f09259b41766da7", + "test" : "dev.morphia.test.aggregation.expressions.TestSetUnion#testSetUnionAccumulatorOperator" }, { "bodyEdit" : null, "files" : { @@ -11011,6 +11452,122 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/shift/shiftUsingAPositiveInteger/scenario.json", "scenarioSha256" : "9119adbfb5daaf4a12e0202158d6f961b333cc21349eda1b3f8a89f469a1c47c", "test" : "dev.morphia.test.aggregation.expressions.TestShift#testShiftUsingAPositiveInteger" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "685a6c7967879161625f7c7a3ad184c607fef36bc76c440e3cda38eb3204ddd3", + "data.json" : "d18629229503cd4d4bb17a530d96977314da5532ed8b817c84dc20c220d1b4f5", + "expected.json" : "dabcd1694bcdf3673dd46d6e4f4f36cb9b3b25f288f66d3a54be5a40e27e2de6", + "name" : "b96c6263085a96f243ee59a62db8712d994e734a16a6212223be91e06a6c6621" + }, + "fixture" : "aggregation/expressions/sin/sineOfValueInDegrees", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation\n .pipeline(addFields().field(\"side_b\", multiply(sin(degreesToRadians(\"$angle_a\")), \"$hypotenuse\"))));\n }", + "legacyBodySha256" : "ad02b8cd42166cf3d32219c7626b7c961644b60f71774713c24947fff6b1fef5", + "legacyMethod" : "testSineOfValueInDegrees", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestSin", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "fa648e6f7ae2353a28b056af94ed8f0ebcc0d7aa09c9a084d60dd9696e05524e", + "text" : "db.trigonometry.aggregate([\n {\n $addFields : {\n \"side_b\" : {\n $multiply : [\n { $sin : {$degreesToRadians : \"$angle_a\"} },\n \"$hypotenuse\"\n ]\n }\n }\n }\n])" + }, { + "role" : "DATA", + "sha256" : "773c20efb8ac7f22d9fe63669ff0a97a9612012db10916e18028913ad0e4f776", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"53.13010235415597870314438744090659\"),\n \"hypotenuse\" : NumberDecimal(\"5\")\n}" + }, { + "role" : "EXPECTED", + "sha256" : "41f5b9e8279bbaf36557fed71b151c17ead1f1e46637b168ac90c17c76afdb22", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"53.13010235415597870314438744090659\"),\n \"side_b\" : NumberDecimal(\"4.000000000000000000000000000000000\"),\n \"hypotenuse\" : NumberDecimal(\"5\"),\n}" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "main :: Sine of Value in Degrees", + "fixture" : "aggregation/expressions/sin/sineOfValueInDegrees", + "fixtureFiles" : { + "action.json" : "685a6c7967879161625f7c7a3ad184c607fef36bc76c440e3cda38eb3204ddd3", + "data.json" : "d18629229503cd4d4bb17a530d96977314da5532ed8b817c84dc20c220d1b4f5", + "expected.json" : "dabcd1694bcdf3673dd46d6e4f4f36cb9b3b25f288f66d3a54be5a40e27e2de6", + "name" : "b96c6263085a96f243ee59a62db8712d994e734a16a6212223be91e06a6c6621" + }, + "includes" : [ ], + "origin" : "948049a3364491f4905246224922d2dbb4197154", + "pageBlob" : "2bea14aa7ebe97bf5e22cb59839ed118a3fc32fd", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "8562c94b38de3e8c83552bcd41558548e5220eef", + "path" : "source/reference/operator/aggregation/sin.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json", + "scenarioSha256" : "caa8945bbabdde910c4b33185ee7bd1762883bab6ed3133f45080c2cdb8015da", + "test" : "dev.morphia.test.aggregation.expressions.TestSin#testSineOfValueInDegrees" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "f8447a898f3dbec40d2e790f72b4de48ce793f1723b9bf8171be321faea41b9d", + "data.json" : "6f563aefefe5aa801f68cd9b63f15dcb642d097b3c464591ead97d15e2ec92c4", + "expected.json" : "b452f99e86df8d75cbc56a92e115ceaf5504818ef572b4d59b0ce15a4cc2cb07", + "name" : "c178da78dfa09e1789ca83af994f515667c1ca95f7d248688f7c3da9721a792c" + }, + "fixture" : "aggregation/expressions/sin/sineOfValueInRadians", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline((aggregation) -> aggregation\n .pipeline(addFields().field(\"side_b\", multiply(sin(\"$angle_a\"), \"$hypotenuse\"))));\n }", + "legacyBodySha256" : "6d9eef3c37da8d9c06fc4c6534d54938ceeb95e1ad2f4ad96b089c23607545b2", + "legacyMethod" : "testSineOfValueInRadians", + "legacyType" : "dev.morphia.test.aggregation.expressions.TestSin", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "dd1067bc89e28b1689ef13b0a9cd6cb51c0728edc800ee94fdcbb11685c89d0d", + "text" : "db.trigonometry.aggregate([\n {\n $addFields : {\n \"side_b\" : {\n $multiply : [\n { $sin : \"$angle_a\" },\n \"$hypotenuse\"\n ]\n }\n }\n }\n])" + }, { + "role" : "DATA", + "sha256" : "3617967fbf8dd3294f1ef06f3a93369c25d15f7136bab6f29f1773244f0981cf", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"0.9272952180016122324285124629224288\"),\n \"hypotenuse\" : NumberDecimal(\"5\")\n}" + }, { + "role" : "EXPECTED", + "sha256" : "db5c58717fcd7dab67885e06fe40e56e6449f814fedafce330ed29db10cbc54b", + "text" : "{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"angle_a\" : NumberDecimal(\"0.9272952180016122324285124629224288\"),\n \"side_b\" : NumberDecimal(\"4.000000000000000000000000000000000\"),\n \"hypotenuse\" : NumberDecimal(\"5\"),\n}" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "main :: Sine of Value in Radians", + "fixture" : "aggregation/expressions/sin/sineOfValueInRadians", + "fixtureFiles" : { + "action.json" : "f8447a898f3dbec40d2e790f72b4de48ce793f1723b9bf8171be321faea41b9d", + "data.json" : "6f563aefefe5aa801f68cd9b63f15dcb642d097b3c464591ead97d15e2ec92c4", + "expected.json" : "b452f99e86df8d75cbc56a92e115ceaf5504818ef572b4d59b0ce15a4cc2cb07", + "name" : "c178da78dfa09e1789ca83af994f515667c1ca95f7d248688f7c3da9721a792c" + }, + "includes" : [ ], + "origin" : "3ed9dc5c1fb30de5717e0d52d8b63a1f7a17bf8d", + "pageBlob" : "2bea14aa7ebe97bf5e22cb59839ed118a3fc32fd", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "8562c94b38de3e8c83552bcd41558548e5220eef", + "path" : "source/reference/operator/aggregation/sin.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json", + "scenarioSha256" : "f2268619e9df8203b5b73a928192c5dc0548aba6862b0e6afe0eb4cd89d7161d", + "test" : "dev.morphia.test.aggregation.expressions.TestSin#testSineOfValueInRadians" }, { "bodyEdit" : null, "files" : { @@ -14677,6 +15234,122 @@ "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/stages/bucket/useBucketWithFacetToBucketByMultipleFields/scenario.json", "scenarioSha256" : "fc5a9f5fc92db2f058f71d57416a0c162b9148d5bc58da42e305f3efffa0475b", "test" : "dev.morphia.test.aggregation.stages.TestBucket#testUseBucketWithFacetToBucketByMultipleFields" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "519b78ca7c0cdd3a146623ce64d78f3234c554b6684aa236567651ab6362a76f", + "data.json" : "fe47cc7fe7daf092dbbd29a2a308f7737714df927a2e8ebf5d72198c65a9dcfa", + "expected.json" : "710a75be96e8cbce742d2545f07a4166af94999cf3c4edb32a475a05fc0971c9", + "name" : "bccad21647fb77b47baa65e307f5c359afdfb3530879a45e312aad98759af7cf" + }, + "fixture" : "aggregation/stages/bucketAuto/multiFacetedAggregation", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline(new ActionTestOptions().orderMatters(false),\n (aggregation) -> aggregation.pipeline(facet().field(\"price\", autoBucket().groupBy(\"$price\").buckets(4))\n .field(\"year\",\n autoBucket().groupBy(\"$year\").buckets(3).outputField(\"count\", sum(1))\n .outputField(\"years\", push(\"$year\")))\n .field(\"area\", autoBucket().groupBy(multiply(\"$dimensions.height\", \"$dimensions.width\"))\n .buckets(4).outputField(\"count\", sum(1)).outputField(\"titles\", push(\"$title\")))));\n }", + "legacyBodySha256" : "ea1a840973beea8b5fd974f2bc8ce2df606dd66d17858a5635dd8cc1bad318af", + "legacyMethod" : "testMultiFacetedAggregation", + "legacyType" : "dev.morphia.test.aggregation.stages.TestBucketAuto", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "499914eb60ae9b825f8a8c26d2d9199cc95fe72163a0d6a7f91be98411197e6f", + "text" : "db.artwork.aggregate( [\n {\n $facet: {\n \"price\": [\n {\n $bucketAuto: {\n groupBy: \"$price\",\n buckets: 4\n }\n }\n ],\n \"year\": [\n { \n $bucketAuto: {\n groupBy: \"$year\",\n buckets: 3,\n output: {\n \"count\": { $sum: 1 },\n \"years\": { $push: \"$year\" }\n }\n }\n }\n ],\n \"area\": [\n {\n $bucketAuto: {\n groupBy: {\n $multiply: [ \"$dimensions.height\", \"$dimensions.width\" ] \n },\n buckets: 4,\n output: {\n \"count\": { $sum: 1 },\n \"titles\": { $push: \"$title\" }\n }\n }\n }\n ]\n }\n }\n] )" + }, { + "role" : "DATA", + "sha256" : "d33285b29f03ca2b998f2342e97921c4dbeb54127a115233eba40cb49896f92d", + "text" : "{ \"_id\" : 1, \"title\" : \"The Pillars of Society\", \"artist\" : \"Grosz\", \"year\" : 1926,\n \"price\" : NumberDecimal(\"199.99\"),\n \"dimensions\" : { \"height\" : 39, \"width\" : 21, \"units\" : \"in\" } }\n{ \"_id\" : 2, \"title\" : \"Melancholy III\", \"artist\" : \"Munch\", \"year\" : 1902,\n \"price\" : NumberDecimal(\"280.00\"),\n \"dimensions\" : { \"height\" : 49, \"width\" : 32, \"units\" : \"in\" } }\n{ \"_id\" : 3, \"title\" : \"Dancer\", \"artist\" : \"Miro\", \"year\" : 1925,\n \"price\" : NumberDecimal(\"76.04\"),\n \"dimensions\" : { \"height\" : 25, \"width\" : 20, \"units\" : \"in\" } }\n{ \"_id\" : 4, \"title\" : \"The Great Wave off Kanagawa\", \"artist\" : \"Hokusai\",\n \"price\" : NumberDecimal(\"167.30\"),\n \"dimensions\" : { \"height\" : 24, \"width\" : 36, \"units\" : \"in\" } }\n{ \"_id\" : 5, \"title\" : \"The Persistence of Memory\", \"artist\" : \"Dali\", \"year\" : 1931,\n \"price\" : NumberDecimal(\"483.00\"),\n \"dimensions\" : { \"height\" : 20, \"width\" : 24, \"units\" : \"in\" } }\n{ \"_id\" : 6, \"title\" : \"Composition VII\", \"artist\" : \"Kandinsky\", \"year\" : 1913,\n \"price\" : NumberDecimal(\"385.00\"),\n \"dimensions\" : { \"height\" : 30, \"width\" : 46, \"units\" : \"in\" } }\n{ \"_id\" : 7, \"title\" : \"The Scream\", \"artist\" : \"Munch\",\n \"price\" : NumberDecimal(\"159.00\"),\n \"dimensions\" : { \"height\" : 24, \"width\" : 18, \"units\" : \"in\" } }\n{ \"_id\" : 8, \"title\" : \"Blue Flower\", \"artist\" : \"O'Keefe\", \"year\" : 1918,\n \"price\" : NumberDecimal(\"118.42\"),\n \"dimensions\" : { \"height\" : 24, \"width\" : 20, \"units\" : \"in\" } }" + }, { + "role" : "EXPECTED", + "sha256" : "b94feaa20f3b9ecf9eb7a65c27842076d2efb39589b5e4691b88ae860f866a58", + "text" : "{\n \"area\" : [\n {\n \"_id\" : { \"min\" : 432, \"max\" : 500 },\n \"count\" : 3,\n \"titles\" : [\n \"The Scream\",\n \"The Persistence of Memory\",\n \"Blue Flower\"\n ]\n },\n {\n \"_id\" : { \"min\" : 500,\t\"max\" : 864 },\n \"count\" : 2,\n \"titles\" : [\n \"Dancer\",\n \"The Pillars of Society\"\n ]\n },\n {\n \"_id\" : { \"min\" : 864, \"max\" : 1568 },\n \"count\" : 2,\n \"titles\" : [\n \"The Great Wave off Kanagawa\",\n \"Composition VII\"\n ]\n },\n {\n \"_id\" : { \"min\" : 1568, \"max\" : 1568 },\n \"count\" : 1,\n \"titles\" : [\n \"Melancholy III\"\n ]\n }\n ],\n \"price\" : [\n {\n \"_id\" : { \"min\" : NumberDecimal(\"76.04\"), \"max\" : NumberDecimal(\"159.00\") },\n \"count\" : 2\n },\n {\n \"_id\" : { \"min\" : NumberDecimal(\"159.00\"), \"max\" : NumberDecimal(\"199.99\") },\n \"count\" : 2\n },\n {\n \"_id\" : { \"min\" : NumberDecimal(\"199.99\"), \"max\" : NumberDecimal(\"385.00\") },\n \"count\" : 2 },\n {\n \"_id\" : { \"min\" : NumberDecimal(\"385.00\"), \"max\" : NumberDecimal(\"483.00\") },\n \"count\" : 2\n }\n ],\n \"year\" : [\n { \"_id\" : { \"min\" : null, \"max\" : 1913 }, \"count\" : 3, \"years\" : [ 1902 ] },\n { \"_id\" : { \"min\" : 1913, \"max\" : 1926 }, \"count\" : 3, \"years\" : [ 1913, 1918, 1925 ] },\n { \"_id\" : { \"min\" : 1926, \"max\" : 1931 }, \"count\" : 2, \"years\" : [ 1926, 1931 ] }\n ]\n}" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Multi-Faceted Aggregation", + "fixture" : "aggregation/stages/bucketAuto/multiFacetedAggregation", + "fixtureFiles" : { + "action.json" : "519b78ca7c0cdd3a146623ce64d78f3234c554b6684aa236567651ab6362a76f", + "data.json" : "fe47cc7fe7daf092dbbd29a2a308f7737714df927a2e8ebf5d72198c65a9dcfa", + "expected.json" : "710a75be96e8cbce742d2545f07a4166af94999cf3c4edb32a475a05fc0971c9", + "name" : "bccad21647fb77b47baa65e307f5c359afdfb3530879a45e312aad98759af7cf" + }, + "includes" : [ ], + "origin" : "7ad9ac5e4d31c5035284090ab13521e17467015f", + "pageBlob" : "3b07c7071063998d64970ee0626c4e334f7a7091", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "ab1ddea48c5a51dc16b4672f276f6b6c6b132ff0", + "path" : "source/reference/operator/aggregation/bucketAuto.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the facets as area, price, year; $facet returns them in the pipeline's order, price, year, area; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json", + "scenarioSha256" : "a3f6db877bf3b9af4d5efa5ed755e23ef3d0f9c78a7621e736c33ca73ddd2778", + "test" : "dev.morphia.test.aggregation.stages.TestBucketAuto#testMultiFacetedAggregation" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "1377bf8c0fb76e3c12b0b61f4cf214d24843a4a058a7677840094cdbd5e92d2e", + "data.json" : "4011f64b19c10fb380e1d12362ba80a9ab2da8ca36ce821b1a6e7386cd301ef0", + "expected.json" : "6f9fa081a2fe1d7321e377587db3f1fc5b3768f8fd871656dd81f08c30bd7f56", + "name" : "bccad21647fb77b47baa65e307f5c359afdfb3530879a45e312aad98759af7cf" + }, + "fixture" : "aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline", + "kind" : "CONVERTED", + "legacyBody" : "{\n testPipeline(new ActionTestOptions().orderMatters(false),\n (aggregation) -> aggregation.pipeline(facet().field(\"price\", autoBucket().groupBy(\"$price\").buckets(4))\n .field(\"year\",\n autoBucket().groupBy(\"$year\").buckets(3).outputField(\"count\", sum(1))\n .outputField(\"years\", push(\"$year\")))\n .field(\"area\", autoBucket().groupBy(multiply(\"$dimensions.height\", \"$dimensions.width\"))\n .buckets(4).outputField(\"count\", sum(1)).outputField(\"titles\", push(\"$title\")))));\n }", + "legacyBodySha256" : "ea1a840973beea8b5fd974f2bc8ce2df606dd66d17858a5635dd8cc1bad318af", + "legacyMethod" : "testMultiFacetedAggregationAsPipeline", + "legacyType" : "dev.morphia.test.aggregation.stages.TestBucketAuto", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "499914eb60ae9b825f8a8c26d2d9199cc95fe72163a0d6a7f91be98411197e6f", + "text" : "db.artwork.aggregate( [\n {\n $facet: {\n \"price\": [\n {\n $bucketAuto: {\n groupBy: \"$price\",\n buckets: 4\n }\n }\n ],\n \"year\": [\n { \n $bucketAuto: {\n groupBy: \"$year\",\n buckets: 3,\n output: {\n \"count\": { $sum: 1 },\n \"years\": { $push: \"$year\" }\n }\n }\n }\n ],\n \"area\": [\n {\n $bucketAuto: {\n groupBy: {\n $multiply: [ \"$dimensions.height\", \"$dimensions.width\" ] \n },\n buckets: 4,\n output: {\n \"count\": { $sum: 1 },\n \"titles\": { $push: \"$title\" }\n }\n }\n }\n ]\n }\n }\n] )" + }, { + "role" : "DATA", + "sha256" : "d33285b29f03ca2b998f2342e97921c4dbeb54127a115233eba40cb49896f92d", + "text" : "{ \"_id\" : 1, \"title\" : \"The Pillars of Society\", \"artist\" : \"Grosz\", \"year\" : 1926,\n \"price\" : NumberDecimal(\"199.99\"),\n \"dimensions\" : { \"height\" : 39, \"width\" : 21, \"units\" : \"in\" } }\n{ \"_id\" : 2, \"title\" : \"Melancholy III\", \"artist\" : \"Munch\", \"year\" : 1902,\n \"price\" : NumberDecimal(\"280.00\"),\n \"dimensions\" : { \"height\" : 49, \"width\" : 32, \"units\" : \"in\" } }\n{ \"_id\" : 3, \"title\" : \"Dancer\", \"artist\" : \"Miro\", \"year\" : 1925,\n \"price\" : NumberDecimal(\"76.04\"),\n \"dimensions\" : { \"height\" : 25, \"width\" : 20, \"units\" : \"in\" } }\n{ \"_id\" : 4, \"title\" : \"The Great Wave off Kanagawa\", \"artist\" : \"Hokusai\",\n \"price\" : NumberDecimal(\"167.30\"),\n \"dimensions\" : { \"height\" : 24, \"width\" : 36, \"units\" : \"in\" } }\n{ \"_id\" : 5, \"title\" : \"The Persistence of Memory\", \"artist\" : \"Dali\", \"year\" : 1931,\n \"price\" : NumberDecimal(\"483.00\"),\n \"dimensions\" : { \"height\" : 20, \"width\" : 24, \"units\" : \"in\" } }\n{ \"_id\" : 6, \"title\" : \"Composition VII\", \"artist\" : \"Kandinsky\", \"year\" : 1913,\n \"price\" : NumberDecimal(\"385.00\"),\n \"dimensions\" : { \"height\" : 30, \"width\" : 46, \"units\" : \"in\" } }\n{ \"_id\" : 7, \"title\" : \"The Scream\", \"artist\" : \"Munch\",\n \"price\" : NumberDecimal(\"159.00\"),\n \"dimensions\" : { \"height\" : 24, \"width\" : 18, \"units\" : \"in\" } }\n{ \"_id\" : 8, \"title\" : \"Blue Flower\", \"artist\" : \"O'Keefe\", \"year\" : 1918,\n \"price\" : NumberDecimal(\"118.42\"),\n \"dimensions\" : { \"height\" : 24, \"width\" : 20, \"units\" : \"in\" } }" + }, { + "role" : "EXPECTED", + "sha256" : "b94feaa20f3b9ecf9eb7a65c27842076d2efb39589b5e4691b88ae860f866a58", + "text" : "{\n \"area\" : [\n {\n \"_id\" : { \"min\" : 432, \"max\" : 500 },\n \"count\" : 3,\n \"titles\" : [\n \"The Scream\",\n \"The Persistence of Memory\",\n \"Blue Flower\"\n ]\n },\n {\n \"_id\" : { \"min\" : 500,\t\"max\" : 864 },\n \"count\" : 2,\n \"titles\" : [\n \"Dancer\",\n \"The Pillars of Society\"\n ]\n },\n {\n \"_id\" : { \"min\" : 864, \"max\" : 1568 },\n \"count\" : 2,\n \"titles\" : [\n \"The Great Wave off Kanagawa\",\n \"Composition VII\"\n ]\n },\n {\n \"_id\" : { \"min\" : 1568, \"max\" : 1568 },\n \"count\" : 1,\n \"titles\" : [\n \"Melancholy III\"\n ]\n }\n ],\n \"price\" : [\n {\n \"_id\" : { \"min\" : NumberDecimal(\"76.04\"), \"max\" : NumberDecimal(\"159.00\") },\n \"count\" : 2\n },\n {\n \"_id\" : { \"min\" : NumberDecimal(\"159.00\"), \"max\" : NumberDecimal(\"199.99\") },\n \"count\" : 2\n },\n {\n \"_id\" : { \"min\" : NumberDecimal(\"199.99\"), \"max\" : NumberDecimal(\"385.00\") },\n \"count\" : 2 },\n {\n \"_id\" : { \"min\" : NumberDecimal(\"385.00\"), \"max\" : NumberDecimal(\"483.00\") },\n \"count\" : 2\n }\n ],\n \"year\" : [\n { \"_id\" : { \"min\" : null, \"max\" : 1913 }, \"count\" : 3, \"years\" : [ 1902 ] },\n { \"_id\" : { \"min\" : 1913, \"max\" : 1926 }, \"count\" : 3, \"years\" : [ 1913, 1918, 1925 ] },\n { \"_id\" : { \"min\" : 1926, \"max\" : 1931 }, \"count\" : 2, \"years\" : [ 1926, 1931 ] }\n ]\n}" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Multi-Faceted Aggregation", + "fixture" : "aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline", + "fixtureFiles" : { + "action.json" : "1377bf8c0fb76e3c12b0b61f4cf214d24843a4a058a7677840094cdbd5e92d2e", + "data.json" : "4011f64b19c10fb380e1d12362ba80a9ab2da8ca36ce821b1a6e7386cd301ef0", + "expected.json" : "6f9fa081a2fe1d7321e377587db3f1fc5b3768f8fd871656dd81f08c30bd7f56", + "name" : "bccad21647fb77b47baa65e307f5c359afdfb3530879a45e312aad98759af7cf" + }, + "includes" : [ ], + "origin" : "7ad9ac5e4d31c5035284090ab13521e17467015f", + "pageBlob" : "3b07c7071063998d64970ee0626c4e334f7a7091", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "PIPELINE", + "source" : { + "commit" : "ab1ddea48c5a51dc16b4672f276f6b6c6b132ff0", + "path" : "source/reference/operator/aggregation/bucketAuto.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "publishedSkip" : "a page error: the page prints the facets as area, price, year; $facet returns them in the pipeline's order, price, year, area; serialization and behavior pass", + "scenario" : "core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json", + "scenarioSha256" : "9cec8d232c53f0b4122c277f8b12d87d43316adef05dce727267ba913a441af8", + "test" : "dev.morphia.test.aggregation.stages.TestBucketAuto#testMultiFacetedAggregationAsPipeline" }, { "bodyEdit" : null, "files" : { diff --git a/audits/catalog/form-migration.json b/audits/catalog/form-migration.json index 0150143464c..b00fe87b0ca 100644 --- a/audits/catalog/form-migration.json +++ b/audits/catalog/form-migration.json @@ -1,55 +1,5 @@ { "overrides" : [ { - "blocks" : [ { - "role" : "ACTION", - "sha256" : "505edb1e4bde2908694f17718f020da56a9df0140f79eab66f2d9f3d76ee0318", - "text" : "db.flowers.aggregate(\n [\n { $project: { flowerFieldA:1, flowerFieldB: 1, allValues: { $setUnion: [ \"$flowerFieldA\", \"$flowerFieldB\" ] }, _id: 0 } }\n ]\n)" - }, { - "role" : "DATA", - "sha256" : "6443ea787dad4fdfbd05b758c7838ea1b3cd69c19b2e0fe36fad50c454f6eeed", - "text" : "db.flowers.insertMany( [\n { \"_id\" : 1, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\" ] },\n { \"_id\" : 2, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"orchid\", \"rose\", \"orchid\" ] },\n { \"_id\" : 3, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\", \"jasmine\" ] },\n { \"_id\" : 4, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"jasmine\", \"rose\" ] },\n { \"_id\" : 5, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ ] },\n { \"_id\" : 6, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\" ], [ \"orchid\" ] ] },\n { \"_id\" : 7, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\", \"orchid\" ] ] },\n { \"_id\" : 8, \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ ] },\n { \"_id\" : 9, \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ \"rose\" ] }\n] ) " - }, { - "role" : "EXPECTED", - "sha256" : "1512ea57843cc59b806529b1377d79f1a5b4576eae873a1ce12af6a456d87d8b", - "text" : "{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"rose\", \"orchid\" ], \"allValues\": [ \"orchid\", \"rose\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"orchid\", \"rose\", \"orchid\" ], \"allValues\": [ \"orchid\", \"rose\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"rose\", \"orchid\", \"jasmine\" ], \"allValues\": [ \"orchid\", \"rose\", \"jasmine\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ \"jasmine\", \"rose\" ], \"allValues\": [ \"orchid\", \"rose\", \"jasmine\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ ], \"allValues\": [ \"orchid\", \"rose\" ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ [ \"rose\" ], [ \"orchid\" ] ], \"allValues\": [ \"orchid\", \"rose\", [ \"rose\" ], [ \"orchid\" ] ] }\n{ \"flowerFieldA\": [ \"rose\", \"orchid\" ], \"flowerFieldB\": [ [ \"rose\", \"orchid\" ] ], \"allValues\": [ \"orchid\", \"rose\", [ \"rose\", \"orchid\" ] ] }\n{ \"flowerFieldA\": [ ], \"flowerFieldB\": [ ], \"allValues\": [ ] }\n{ \"flowerFieldA\": [ ], \"flowerFieldB\": [ \"rose\" ], \"allValues\": [ \"rose\" ] }" - } ], - "collections" : { }, - "corrections" : [ ], - "example" : "main", - "fixture" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator", - "fixtureFiles" : { - "action.json" : "58a773e31fc06aca6ece771f62acaa30b338a6c3a2e6a99c060c1bd7cc7833dd", - "data.json" : "01b6f83876510cb9f326b4cef4476f019a54cd5894b583866e11f34cdeae218a", - "expected.json" : "1512ea57843cc59b806529b1377d79f1a5b4576eae873a1ce12af6a456d87d8b", - "name" : "0d6e4079e36703ebd37c00722f5891d28b0e2811dc114b129215123adcce3605" - }, - "includes" : [ { - "blob" : "9ba8fe6005b2e4e5e7a77bbf7c6535da3355c571", - "path" : "source/includes/important-set-operator-semantics.rst" - }, { - "blob" : "3ae8bf736443eaa8cf84e56de8d30b33dd6449bc", - "path" : "source/includes/extracts-fact-agg-top-level-expressions.yaml" - }, { - "blob" : "5366b8d724f1705e143d55a10e620d6fe50b37de", - "path" : "source/includes/extracts-parent-fact-agg-top-level-expressions.yaml" - } ], - "origin" : "948049a3364491f4905246224922d2dbb4197154", - "pageBlob" : "5fb7cb7683edfc6e33c1129ce27a7d763725669c", - "retiredLock" : { - "name" : "lock", - "sha256" : "e17fac3fb207733c3d2910b145f4878ecdbee2a2d8c8f7d6337bb23cd582cc6b", - "text" : "rearrange suppress id\n" - }, - "retypes" : [ ], - "rules" : [ "PROJECT_ID_FIRST" ], - "shape" : "PIPELINE", - "source" : { - "commit" : "e0848b6ada3e691ecada5da38e717de2d2545843", - "path" : "source/reference/operator/aggregation/setUnion.txt", - "relation" : "AT_ORIGIN" - }, - "unexpandedIncludes" : [ ] - }, { "blocks" : [ { "role" : "ACTION", "sha256" : "f4d68dd8cdbf77d323571973710fe8085111e5956b009ddb032e4a3f44ac8488", @@ -257,7 +207,7 @@ "gap.REJECTED" : 0, "gap.RESIDUAL_DIFFERENCE" : 0, "gap.SOURCE_UNSUPPORTED" : 0, - "overrides" : 4, + "overrides" : 3, "overrides.corrected" : 0, "overrides.exact" : 1, "overrides.retyped" : 0, @@ -267,7 +217,7 @@ "rule.FIELD_OPERATORS_AND" : 0, "rule.NAMED_ARGUMENTS" : 1, "rule.PROJECTION_FLAGS" : 0, - "rule.PROJECT_ID_FIRST" : 1, + "rule.PROJECT_ID_FIRST" : 0, "rule.REGEX_FORM" : 0, "rule.SINGLE_ARGUMENT_ARRAY" : 0, "rule.UNWIND_PATH" : 0, diff --git a/audits/catalog/form-review.json b/audits/catalog/form-review.json index a46f8a88845..121505589ae 100644 --- a/audits/catalog/form-review.json +++ b/audits/catalog/form-review.json @@ -1,30 +1,5 @@ { "declarations" : [ { - "corrections" : [ ], - "fixture" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator", - "includes" : [ { - "blob" : "9ba8fe6005b2e4e5e7a77bbf7c6535da3355c571", - "path" : "source/includes/important-set-operator-semantics.rst" - }, { - "blob" : "3ae8bf736443eaa8cf84e56de8d30b33dd6449bc", - "path" : "source/includes/extracts-fact-agg-top-level-expressions.yaml" - }, { - "blob" : "5366b8d724f1705e143d55a10e620d6fe50b37de", - "path" : "source/includes/extracts-parent-fact-agg-top-level-expressions.yaml" - } ], - "justification" : null, - "lock" : "rearrange suppress id\n", - "marker" : "lock", - "origin" : "948049a3364491f4905246224922d2dbb4197154", - "pageBlob" : "5fb7cb7683edfc6e33c1129ce27a7d763725669c", - "retypes" : [ ], - "rules" : [ "PROJECT_ID_FIRST" ], - "source" : { - "commit" : "e0848b6ada3e691ecada5da38e717de2d2545843", - "path" : "source/reference/operator/aggregation/setUnion.txt", - "relation" : "AT_ORIGIN" - } - }, { "corrections" : [ ], "fixture" : "aggregation/stages/densify/densifyTimeSeriesData", "includes" : [ { @@ -1594,6 +1569,35 @@ "path" : "source/reference/operator/aggregation/setIsSubset.txt", "relation" : "AT_ORIGIN" } + }, { + "corrections" : [ ], + "fixture" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator", + "includes" : [ { + "blob" : "9ba8fe6005b2e4e5e7a77bbf7c6535da3355c571", + "path" : "source/includes/important-set-operator-semantics.rst" + }, { + "blob" : "3ae8bf736443eaa8cf84e56de8d30b33dd6449bc", + "path" : "source/includes/extracts-fact-agg-top-level-expressions.yaml" + }, { + "blob" : "5366b8d724f1705e143d55a10e620d6fe50b37de", + "path" : "source/includes/extracts-parent-fact-agg-top-level-expressions.yaml" + } ], + "justification" : null, + "lock" : "rearrange suppress id\n", + "marker" : "lock", + "origin" : "948049a3364491f4905246224922d2dbb4197154", + "pageBlob" : "5fb7cb7683edfc6e33c1129ce27a7d763725669c", + "retypes" : [ ], + "rules" : [ "PROJECT_ID_FIRST" ], + "source" : { + "commit" : "e0848b6ada3e691ecada5da38e717de2d2545843", + "path" : "source/reference/operator/aggregation/setUnion.txt", + "relation" : "AT_ORIGIN" + }, + "unorderedArrays" : [ { + "path" : "/allValues", + "reason" : "$setUnion does not order the array it returns: the page prints one order, and the server returns another" + } ] }, { "corrections" : [ ], "fixture" : "aggregation/expressions/size/sizeExpressionOperator", diff --git a/audits/catalog/legacy-references.json b/audits/catalog/legacy-references.json index 1cdfdd9b500..54f999d327f 100644 --- a/audits/catalog/legacy-references.json +++ b/audits/catalog/legacy-references.json @@ -238,7 +238,11 @@ "path" : "source/reference/operator/aggregation/addToSet.txt", "relation" : "AT_ORIGIN" }, - "unexpandedIncludes" : [ ] + "unexpandedIncludes" : [ ], + "unorderedArrays" : [ { + "path" : "/itemsSold", + "reason" : "$addToSet does not order the array it builds: the server lists the set's members in a different order between runs on identical data, and the page prints one order" + } ] }, { "blocks" : [ { "role" : "ACTION", diff --git a/audits/src/main/kotlin/dev/morphia/audits/generate/Candidates.kt b/audits/src/main/kotlin/dev/morphia/audits/generate/Candidates.kt index 85fb51838a6..7fee8eeeb08 100644 --- a/audits/src/main/kotlin/dev/morphia/audits/generate/Candidates.kt +++ b/audits/src/main/kotlin/dev/morphia/audits/generate/Candidates.kt @@ -93,8 +93,7 @@ object Candidates { val ledger = AuditJson.fixtureMigration(Files.readString(root.resolve(LEDGER))) val contents = sortedMapOf() ledger.migrations.forEach { - contents[it.scenario] = - FixtureMigration.scenario(it.override, it.ordered, it.options).toByteArray() + contents[it.scenario] = FixtureMigration.scenario(it).toByteArray() } val current = currentManifest(root) val generation = generation(root, current) diff --git a/audits/src/main/kotlin/dev/morphia/audits/repairs/FixtureMigration.kt b/audits/src/main/kotlin/dev/morphia/audits/repairs/FixtureMigration.kt index bdf01a8f6b4..b7b14f3bcb9 100644 --- a/audits/src/main/kotlin/dev/morphia/audits/repairs/FixtureMigration.kt +++ b/audits/src/main/kotlin/dev/morphia/audits/repairs/FixtureMigration.kt @@ -57,6 +57,11 @@ data class MigratedFixture( */ @get:JsonInclude(JsonInclude.Include.NON_EMPTY) val fileEdits: Map = emptyMap(), + /** + * A reviewed reason the published check does not run: the page prints results the server does + * not return (a page error), or that cannot be read. Serialization and behavior stay strict. + */ + @get:JsonInclude(JsonInclude.Include.NON_NULL) val publishedSkip: String? = null, ) /** @@ -259,6 +264,15 @@ object FixtureMigration { private val unordered = Regex("""\.orderMatters\s*\(\s*false\s*\)""") + /** The scenario of a ledger entry: its override's, with its options and reviewed skip. */ + fun scenario(migrated: MigratedFixture): String = + scenario( + migrated.override, + migrated.ordered, + migrated.options, + publishedSkip = migrated.publishedSkip, + ) + /** * The scenario a runner executes for [override]: its documented data, action and results. * [ordered] is whether the legacy test compared results in order, and [options] are its other @@ -271,6 +285,7 @@ object FixtureMigration { ordered: Boolean, options: List = emptyList(), dataset: String? = null, + publishedSkip: String? = null, ): String { require(options.all { it.name in mappedOptions && it.name != "orderMatters" }) { "${override.fixture}: options ${options.map { it.name }} are not mapped" @@ -285,6 +300,7 @@ object FixtureMigration { skipped["results"] = BsonString("the legacy test skipped its data check (skipDataCheck)") } + publishedSkip?.let { skipped["published"] = BsonString(it) } if (dataset != null) { skipped["results"] = BsonString( @@ -600,7 +616,13 @@ object FixtureMigration { return ledger.copy( migrations = ledger.migrations.map { migrated -> - val text = scenario(migrated.override, migrated.ordered, migrated.options) + val text = + scenario( + migrated.override, + migrated.ordered, + migrated.options, + publishedSkip = migrated.publishedSkip, + ) Files.writeString(root.resolve(migrated.scenario), text) migrated.copy(scenarioSha256 = sha256(text.toByteArray())) } @@ -847,7 +869,15 @@ object FixtureMigration { if (sha256(text.toByteArray()) != migrated.scenarioSha256) { problems += "${migrated.fixture}: scenario changed since the migration" } - if (text != scenario(migrated.override, migrated.ordered, migrated.options)) { + if ( + text != + scenario( + migrated.override, + migrated.ordered, + migrated.options, + publishedSkip = migrated.publishedSkip, + ) + ) { problems += "${migrated.fixture}: scenario is not its override's documented source" } diff --git a/audits/src/test/kotlin/dev/morphia/audits/offline/FixtureMigrationTest.kt b/audits/src/test/kotlin/dev/morphia/audits/offline/FixtureMigrationTest.kt index 709f40ba48f..48a7676496f 100644 --- a/audits/src/test/kotlin/dev/morphia/audits/offline/FixtureMigrationTest.kt +++ b/audits/src/test/kotlin/dev/morphia/audits/offline/FixtureMigrationTest.kt @@ -25,12 +25,7 @@ class FixtureMigrationTest { @Test fun scenariosAreTheirOverridesDocumentedSource() { - ledger.migrations.forEach { - assertEquals( - FixtureMigration.scenario(it.override, it.ordered, it.options), - read(it.scenario), - ) - } + ledger.migrations.forEach { assertEquals(FixtureMigration.scenario(it), read(it.scenario)) } } @Test diff --git a/audits/src/test/kotlin/dev/morphia/audits/offline/FormMigrationTest.kt b/audits/src/test/kotlin/dev/morphia/audits/offline/FormMigrationTest.kt index 26f060ba55c..1bdb7e90330 100644 --- a/audits/src/test/kotlin/dev/morphia/audits/offline/FormMigrationTest.kt +++ b/audits/src/test/kotlin/dev/morphia/audits/offline/FormMigrationTest.kt @@ -989,7 +989,7 @@ class FormMigrationTest { .map { it.fixture } .toSet(), ) - assertEquals(4, report.overrides.size) + assertEquals(3, report.overrides.size) assertEquals(0, report.unresolved.size) } diff --git a/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java b/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java index 58064ff09c7..f7a6d9aa0ab 100644 --- a/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java +++ b/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java @@ -299,6 +299,10 @@ private void run(OperatorCase operatorCase, String kind, Shape shape, referenceResults = without(ignore, referenceResults); morphiaResults = without(ignore, morphiaResults); BsonDocument expected = scenario.getDocument("expected"); + // A reviewed page error: the page prints results the server does not return. + if (skipped.containsKey("published")) { + return; + } if (expected.containsKey("documents")) { List published = without(ignore, expected.getArray("documents").getValues()); if (!StrictBson.equal(published, morphiaResults, ordered, unordered)) { @@ -367,7 +371,7 @@ private static void supported(OperatorCase operatorCase, BsonDocument scenario) unsupported.add("scenario fields " + scenario.keySet()); } BsonDocument skipped = scenario.getDocument("skipped", new BsonDocument()); - if (!Set.of("serialization", "results").containsAll(skipped.keySet()) + if (!Set.of("serialization", "results", "published").containsAll(skipped.keySet()) || skipped.values().stream().anyMatch(reason -> !reason.isString() || reason.asString().getValue().isBlank())) { unsupported.add("skipped " + skipped); } diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/action.json deleted file mode 100644 index 0c8534fb353..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/action.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - $group: - { - _id: { day: { $dayOfYear: "$date"}, year: { $year: "$date" } }, - itemsSold: { $addToSet: "$item" } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/data.json deleted file mode 100644 index 4acdb5121fe..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/data.json +++ /dev/null @@ -1,5 +0,0 @@ -{ _id : 1, "item" : "abc", "price" : 10, "quantity" : 2, "date" : ISODate("2014-01-01T08:00:00Z") }, -{ _id : 2, "item" : "jkl", "price" : 20, "quantity" : 1, "date" : ISODate("2014-02-03T09:00:00Z") }, -{ _id : 3, "item" : "xyz", "price" : 5, "quantity" : 5, "date" : ISODate("2014-02-03T09:05:00Z") }, -{ _id : 4, "item" : "abc", "price" : 10, "quantity" : 10, "date" : ISODate("2014-02-15T08:00:00Z") }, -{ _id : 5, "item" : "xyz", "price" : 5, "quantity" : 10, "date" : ISODate("2014-02-15T09:12:00Z") } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/expected.json deleted file mode 100644 index afc0c7239d9..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "_id" : { "day" : 46, "year" : 2014 }, "itemsSold" : [ "xyz", "abc" ] } -{ "_id" : { "day" : 34, "year" : 2014 }, "itemsSold" : [ "xyz", "jkl" ] } -{ "_id" : { "day" : 1, "year" : 2014 }, "itemsSold" : [ "abc" ] } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/name deleted file mode 100644 index 6117677cab5..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/name +++ /dev/null @@ -1 +0,0 @@ -Use in ``$group`` Stage \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json new file mode 100644 index 00000000000..29c91970364 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json @@ -0,0 +1,260 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/addToSet/useInGroupStage", + "title": "Use in ``$group`` Stage", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "d84aad6501cde0bf6dcb41c1ce9bddbabc8e3acb", + "path": "source/reference/operator/aggregation/addToSet.txt", + "blob": "3eab8a0f74fa1ac382290e0d2b593ef2c2c0dbef" + }, + "dataset": null, + "collections": { + "sales": [ + { + "_id": { + "$numberInt": "1" + }, + "item": "abc", + "price": { + "$numberInt": "10" + }, + "quantity": { + "$numberInt": "2" + }, + "date": { + "$date": { + "$numberLong": "1388563200000" + } + } + }, + { + "_id": { + "$numberInt": "2" + }, + "item": "jkl", + "price": { + "$numberInt": "20" + }, + "quantity": { + "$numberInt": "1" + }, + "date": { + "$date": { + "$numberLong": "1391418000000" + } + } + }, + { + "_id": { + "$numberInt": "3" + }, + "item": "xyz", + "price": { + "$numberInt": "5" + }, + "quantity": { + "$numberInt": "5" + }, + "date": { + "$date": { + "$numberLong": "1391418300000" + } + } + }, + { + "_id": { + "$numberInt": "4" + }, + "item": "abc", + "price": { + "$numberInt": "10" + }, + "quantity": { + "$numberInt": "10" + }, + "date": { + "$date": { + "$numberLong": "1392451200000" + } + } + }, + { + "_id": { + "$numberInt": "5" + }, + "item": "xyz", + "price": { + "$numberInt": "5" + }, + "quantity": { + "$numberInt": "10" + }, + "date": { + "$date": { + "$numberLong": "1392455520000" + } + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "sales", + "pipeline": [ + { + "$group": { + "_id": { + "day": { + "$dayOfYear": "$date" + }, + "year": { + "$year": "$date" + } + }, + "itemsSold": { + "$addToSet": "$item" + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "day", + "value": { + "whole": { + "$numberInt": "46" + } + } + }, + { + "name": "year", + "value": { + "whole": { + "$numberInt": "2014" + } + } + } + ] + } + }, + { + "name": "itemsSold", + "value": { + "array": [ + { + "text": "xyz" + }, + { + "text": "abc" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "day", + "value": { + "whole": { + "$numberInt": "34" + } + } + }, + { + "name": "year", + "value": { + "whole": { + "$numberInt": "2014" + } + } + } + ] + } + }, + { + "name": "itemsSold", + "value": { + "array": [ + { + "text": "xyz" + }, + { + "text": "jkl" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "day", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "year", + "value": { + "whole": { + "$numberInt": "2014" + } + } + } + ] + } + }, + { + "name": "itemsSold", + "value": { + "array": [ + { + "text": "abc" + } + ] + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "unorderedArrays": [ + "/itemsSold" + ], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/action.json deleted file mode 100644 index baa97bbafa7..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/action.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - $addFields : { - "side_a" : { - $multiply : [ - { $cos : {$degreesToRadians : "$angle_a"} }, - "$hypotenuse" - ] - } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/data.json deleted file mode 100644 index af945b0af3f..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/data.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("53.13010235415597870314438744090659"), "hypotenuse" : NumberDecimal("5")} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/expected.json deleted file mode 100644 index c84671c8fc6..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("53.13010235415597870314438744090659"), "side_a" : NumberDecimal("2.999999999999999999999999999999999"), "hypotenuse" : NumberDecimal("5"),} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/name deleted file mode 100644 index 419ec35d538..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/name +++ /dev/null @@ -1 +0,0 @@ -main :: Cosine of Value in Degrees \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json new file mode 100644 index 00000000000..72b261d4395 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json @@ -0,0 +1,98 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/cos/cosineOfValueInDegrees", + "title": "main :: Cosine of Value in Degrees", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "8562c94b38de3e8c83552bcd41558548e5220eef", + "path": "source/reference/operator/aggregation/cos.txt", + "blob": "fea873bacbd276ce279f34a83646e17aa7a28a5e" + }, + "dataset": null, + "collections": { + "trigonometry": [ + { + "_id": { + "$oid": "5c50782193f833234ba90d85" + }, + "angle_a": { + "$numberDecimal": "53.13010235415597870314438744090659" + }, + "hypotenuse": { + "$numberDecimal": "5" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "trigonometry", + "pipeline": [ + { + "$addFields": { + "side_a": { + "$multiply": [ + { + "$cos": { + "$degreesToRadians": "$angle_a" + } + }, + "$hypotenuse" + ] + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "exact": { + "$oid": "5c50782193f833234ba90d85" + } + } + }, + { + "name": "angle_a", + "value": { + "decimal": "53.13010235415597870314438744090659" + } + }, + { + "name": "side_a", + "value": { + "decimal": "2.999999999999999999999999999999999" + } + }, + { + "name": "hypotenuse", + "value": { + "decimal": "5" + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/action.json deleted file mode 100644 index b5334e8ed3a..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/action.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - $addFields : { - "side_b" : { - $multiply : [ - { $cos : "$angle_a" }, - "$hypotenuse" - ] - } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/data.json deleted file mode 100644 index df0c36c7819..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/data.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("0.9272952180016122324285124629224288"), "hypotenuse" : NumberDecimal("5")} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/expected.json deleted file mode 100644 index 90d0da58a9c..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("0.9272952180016122324285124629224288"), "side_b" : NumberDecimal("3.000000000000000000000000000000000"), "hypotenuse" : NumberDecimal("5"),} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/name deleted file mode 100644 index 373e893030c..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/name +++ /dev/null @@ -1 +0,0 @@ -main :: Cosine of Value in Radians \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json new file mode 100644 index 00000000000..dfa3c5fc024 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json @@ -0,0 +1,96 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/cos/cosineOfValueInRadians", + "title": "main :: Cosine of Value in Radians", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "8562c94b38de3e8c83552bcd41558548e5220eef", + "path": "source/reference/operator/aggregation/cos.txt", + "blob": "fea873bacbd276ce279f34a83646e17aa7a28a5e" + }, + "dataset": null, + "collections": { + "trigonometry": [ + { + "_id": { + "$oid": "5c50782193f833234ba90d85" + }, + "angle_a": { + "$numberDecimal": "0.9272952180016122324285124629224288" + }, + "hypotenuse": { + "$numberDecimal": "5" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "trigonometry", + "pipeline": [ + { + "$addFields": { + "side_b": { + "$multiply": [ + { + "$cos": "$angle_a" + }, + "$hypotenuse" + ] + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "exact": { + "$oid": "5c50782193f833234ba90d85" + } + } + }, + { + "name": "angle_a", + "value": { + "decimal": "0.9272952180016122324285124629224288" + } + }, + { + "name": "side_b", + "value": { + "decimal": "3.000000000000000000000000000000000" + } + }, + { + "name": "hypotenuse", + "value": { + "decimal": "5" + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/action.json deleted file mode 100644 index 4457d891216..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/action.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - $match: - { $expr: - { $gt: [ { $getField: "price.usd" }, 200 ] } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/data.json deleted file mode 100644 index b9c16dcb068..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/data.json +++ /dev/null @@ -1,5 +0,0 @@ -{ _id: 1, item: "sweatshirt", "price.usd": 45.99, qty: 300 }, -{ _id: 2, item: "winter coat", "price.usd": 499.99, qty: 200 }, -{ _id: 3, item: "sun dress", "price.usd": 199.99, qty: 250 }, -{ _id: 4, item: "leather boots", "price.usd": 249.99, qty: 300 }, -{ _id: 5, item: "bow tie", "price.usd": 9.99, qty: 180 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/expected.json deleted file mode 100644 index 2420623c384..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/expected.json +++ /dev/null @@ -1,2 +0,0 @@ -{ _id: 2, item: 'winter coat', qty: 200, 'price.usd': 499.99 }, -{ _id: 4, item: 'leather boots', qty: 300, 'price.usd': 249.99 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/name deleted file mode 100644 index 730c4f3dc1c..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/name +++ /dev/null @@ -1 +0,0 @@ -Query Fields that Contain Periods (``.``) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json new file mode 100644 index 00000000000..dbcd5ff4401 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json @@ -0,0 +1,185 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/getField/queryFieldsThatContainPeriods", + "title": "Query Fields that Contain Periods (``.``)", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "111836fb23076857f0cf9bcce15e694fe4a169e4", + "path": "source/reference/operator/aggregation/getField.txt", + "blob": "899c62457ce159b0bf99eecaef4b51ca30ab7d24" + }, + "dataset": null, + "collections": { + "inventory": [ + { + "_id": { + "$numberInt": "1" + }, + "item": "sweatshirt", + "price.usd": { + "$numberDouble": "45.99" + }, + "qty": { + "$numberInt": "300" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "item": "winter coat", + "price.usd": { + "$numberDouble": "499.99" + }, + "qty": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "item": "sun dress", + "price.usd": { + "$numberDouble": "199.99" + }, + "qty": { + "$numberInt": "250" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "item": "leather boots", + "price.usd": { + "$numberDouble": "249.99" + }, + "qty": { + "$numberInt": "300" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "item": "bow tie", + "price.usd": { + "$numberDouble": "9.99" + }, + "qty": { + "$numberInt": "180" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "inventory", + "pipeline": [ + { + "$match": { + "$expr": { + "$gt": [ + { + "$getField": "price.usd" + }, + { + "$numberInt": "200" + } + ] + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "item", + "value": { + "text": "winter coat" + } + }, + { + "name": "qty", + "value": { + "whole": { + "$numberInt": "200" + } + } + }, + { + "name": "price.usd", + "value": { + "exact": { + "$numberDouble": "499.99" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "4" + } + } + }, + { + "name": "item", + "value": { + "text": "leather boots" + } + }, + { + "name": "qty", + "value": { + "whole": { + "$numberInt": "300" + } + } + }, + { + "name": "price.usd", + "value": { + "exact": { + "$numberDouble": "249.99" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints qty before price.usd; the server returns the fields in the order the page's own insert stores them; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/action.json deleted file mode 100644 index bec4225dc87..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/action.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - $match: - { $expr: - { $gt: [ { $getField: {$literal: "$price" } }, 200 ] } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/data.json deleted file mode 100644 index 8ffab670b92..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/data.json +++ /dev/null @@ -1,5 +0,0 @@ -{ _id: 1, item: "sweatshirt", "$price": 45.99, qty: 300 }, -{ _id: 2, item: "winter coat", "$price": 499.99, qty: 200 }, -{ _id: 3, item: "sun dress", "$price": 199.99, qty: 250 }, -{ _id: 4, item: "leather boots", "$price": 249.99, qty: 300 }, -{ _id: 5, item: "bow tie", "$price": 9.99, qty: 180 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/expected.json deleted file mode 100644 index 9c7e006f621..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/expected.json +++ /dev/null @@ -1,2 +0,0 @@ -{ _id: 2, item: 'winter coat', qty: 200, '$price': 499.99 }, -{ _id: 4, item: 'leather boots', qty: 300, '$price': 249.99 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/name deleted file mode 100644 index bca83b4e1ff..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/name +++ /dev/null @@ -1 +0,0 @@ -Query Fields that Start with a Dollar Sign (``$``) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json new file mode 100644 index 00000000000..aef9689d50d --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json @@ -0,0 +1,187 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/getField/queryFieldsThatStartWithADollarSign", + "title": "Query Fields that Start with a Dollar Sign (``$``)", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "111836fb23076857f0cf9bcce15e694fe4a169e4", + "path": "source/reference/operator/aggregation/getField.txt", + "blob": "899c62457ce159b0bf99eecaef4b51ca30ab7d24" + }, + "dataset": null, + "collections": { + "inventory": [ + { + "_id": { + "$numberInt": "1" + }, + "item": "sweatshirt", + "$price": { + "$numberDouble": "45.99" + }, + "qty": { + "$numberInt": "300" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "item": "winter coat", + "$price": { + "$numberDouble": "499.99" + }, + "qty": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "item": "sun dress", + "$price": { + "$numberDouble": "199.99" + }, + "qty": { + "$numberInt": "250" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "item": "leather boots", + "$price": { + "$numberDouble": "249.99" + }, + "qty": { + "$numberInt": "300" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "item": "bow tie", + "$price": { + "$numberDouble": "9.99" + }, + "qty": { + "$numberInt": "180" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "inventory", + "pipeline": [ + { + "$match": { + "$expr": { + "$gt": [ + { + "$getField": { + "$literal": "$price" + } + }, + { + "$numberInt": "200" + } + ] + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "item", + "value": { + "text": "winter coat" + } + }, + { + "name": "qty", + "value": { + "whole": { + "$numberInt": "200" + } + } + }, + { + "name": "$price", + "value": { + "exact": { + "$numberDouble": "499.99" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "4" + } + } + }, + { + "name": "item", + "value": { + "text": "leather boots" + } + }, + { + "name": "qty", + "value": { + "whole": { + "$numberInt": "300" + } + } + }, + { + "name": "$price", + "value": { + "exact": { + "$numberDouble": "249.99" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the fields in an order other than the one its own insert stores them in, which the server returns; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/action.json deleted file mode 100644 index 53b619ca7df..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/action.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - $project: { - yearNumber: { $isoWeekYear: "$date" } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/data.json deleted file mode 100644 index 72f45444e51..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/data.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "_id" : 1, "date" : ISODate("2016-01-01T00:00:00Z") } -{ "_id" : 2, "date" : ISODate("2016-01-04T00:00:00Z") } -{ "_id" : 3, "date" : ISODate("2015-01-01T00:00:00Z") } -{ "_id" : 4, "date" : ISODate("2014-04-21T00:00:00Z") } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/expected.json deleted file mode 100644 index 855b7a7c057..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "_id" : 1, "yearNumber" : 2015 } -{ "_id" : 2, "yearNumber" : 2016 } -{ "_id" : 3, "yearNumber" : 2015 } -{ "_id" : 4, "yearNumber" : 2014 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/name deleted file mode 100644 index 88d050b1908..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/name +++ /dev/null @@ -1 +0,0 @@ -main \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json new file mode 100644 index 00000000000..1ac83a358ff --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json @@ -0,0 +1,170 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator", + "title": "main", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "6560e617067dff1934063555ec97e57cad362fc8", + "path": "source/reference/operator/aggregation/isoWeekYear.txt", + "blob": "1382e4dfb1f694eaad63993cfe3d19ab9b0a52b5" + }, + "dataset": null, + "collections": { + "anniversaries": [ + { + "_id": { + "$numberInt": "1" + }, + "date": { + "$date": { + "$numberLong": "1451606400000" + } + } + }, + { + "_id": { + "$numberInt": "2" + }, + "date": { + "$date": { + "$numberLong": "1451865600000" + } + } + }, + { + "_id": { + "$numberInt": "3" + }, + "date": { + "$date": { + "$numberLong": "1420070400000" + } + } + }, + { + "_id": { + "$numberInt": "4" + }, + "date": { + "$date": { + "$numberLong": "1398038400000" + } + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "anniversaries", + "pipeline": [ + { + "$project": { + "yearNumber": { + "$isoWeekYear": "$date" + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "yearNumber", + "value": { + "whole": { + "$numberInt": "2015" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "yearNumber", + "value": { + "whole": { + "$numberInt": "2016" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "yearNumber", + "value": { + "whole": { + "$numberInt": "2015" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "4" + } + } + }, + { + "name": "yearNumber", + "value": { + "whole": { + "$numberInt": "2014" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: $isoWeekYear returns a Long, which mongosh prints as Long('2015'); the page prints 2015, which only an Int32 or a Double prints as; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/action.json deleted file mode 100644 index 67dfb80983d..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/action.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - $project: { - _id: 0, - flowerFieldA: 1, - flowerFieldB: 1, - allValues: { - $setUnion: ["$flowerFieldA", "$flowerFieldB"] - } - } - } -] \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/data.json deleted file mode 100644 index 219da114a91..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/data.json +++ /dev/null @@ -1,9 +0,0 @@ -{ "_id" : 1, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ "rose", "orchid" ] }, -{ "_id" : 2, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ "orchid", "rose", "orchid" ] }, -{ "_id" : 3, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ "rose", "orchid", "jasmine" ] }, -{ "_id" : 4, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ "jasmine", "rose" ] }, -{ "_id" : 5, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ ] }, -{ "_id" : 6, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ [ "rose" ], [ "orchid" ] ] }, -{ "_id" : 7, "flowerFieldA" : [ "rose", "orchid" ], "flowerFieldB" : [ [ "rose", "orchid" ] ] }, -{ "_id" : 8, "flowerFieldA" : [ ], "flowerFieldB" : [ ] }, -{ "_id" : 9, "flowerFieldA" : [ ], "flowerFieldB" : [ "rose" ] } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/expected.json deleted file mode 100644 index 6948183d67e..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/expected.json +++ /dev/null @@ -1,9 +0,0 @@ -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ "rose", "orchid" ], "allValues": [ "orchid", "rose" ] } -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ "orchid", "rose", "orchid" ], "allValues": [ "orchid", "rose" ] } -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ "rose", "orchid", "jasmine" ], "allValues": [ "orchid", "rose", "jasmine" ] } -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ "jasmine", "rose" ], "allValues": [ "orchid", "rose", "jasmine" ] } -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ ], "allValues": [ "orchid", "rose" ] } -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ [ "rose" ], [ "orchid" ] ], "allValues": [ "orchid", "rose", [ "rose" ], [ "orchid" ] ] } -{ "flowerFieldA": [ "rose", "orchid" ], "flowerFieldB": [ [ "rose", "orchid" ] ], "allValues": [ "orchid", "rose", [ "rose", "orchid" ] ] } -{ "flowerFieldA": [ ], "flowerFieldB": [ ], "allValues": [ ] } -{ "flowerFieldA": [ ], "flowerFieldB": [ "rose" ], "allValues": [ "rose" ] } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/name deleted file mode 100644 index 88d050b1908..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/name +++ /dev/null @@ -1 +0,0 @@ -main \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json new file mode 100644 index 00000000000..2f26b209122 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json @@ -0,0 +1,570 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/setUnion/setUnionAccumulatorOperator", + "title": "main", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "e0848b6ada3e691ecada5da38e717de2d2545843", + "path": "source/reference/operator/aggregation/setUnion.txt", + "blob": "5fb7cb7683edfc6e33c1129ce27a7d763725669c" + }, + "dataset": null, + "collections": { + "flowers": [ + { + "_id": { + "$numberInt": "1" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [ + "rose", + "orchid" + ] + }, + { + "_id": { + "$numberInt": "2" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [ + "orchid", + "rose", + "orchid" + ] + }, + { + "_id": { + "$numberInt": "3" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [ + "rose", + "orchid", + "jasmine" + ] + }, + { + "_id": { + "$numberInt": "4" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [ + "jasmine", + "rose" + ] + }, + { + "_id": { + "$numberInt": "5" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [] + }, + { + "_id": { + "$numberInt": "6" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [ + [ + "rose" + ], + [ + "orchid" + ] + ] + }, + { + "_id": { + "$numberInt": "7" + }, + "flowerFieldA": [ + "rose", + "orchid" + ], + "flowerFieldB": [ + [ + "rose", + "orchid" + ] + ] + }, + { + "_id": { + "$numberInt": "8" + }, + "flowerFieldA": [], + "flowerFieldB": [] + }, + { + "_id": { + "$numberInt": "9" + }, + "flowerFieldA": [], + "flowerFieldB": [ + "rose" + ] + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "flowers", + "pipeline": [ + { + "$project": { + "flowerFieldA": { + "$numberInt": "1" + }, + "flowerFieldB": { + "$numberInt": "1" + }, + "allValues": { + "$setUnion": [ + "$flowerFieldA", + "$flowerFieldB" + ] + }, + "_id": { + "$numberInt": "0" + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + }, + { + "text": "jasmine" + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + }, + { + "text": "jasmine" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "text": "jasmine" + }, + { + "text": "rose" + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + }, + { + "text": "jasmine" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "array": [ + { + "text": "rose" + } + ] + }, + { + "array": [ + { + "text": "orchid" + } + ] + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + }, + { + "array": [ + { + "text": "rose" + } + ] + }, + { + "array": [ + { + "text": "orchid" + } + ] + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "orchid" + }, + { + "text": "rose" + }, + { + "array": [ + { + "text": "rose" + }, + { + "text": "orchid" + } + ] + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [] + } + }, + { + "name": "allValues", + "value": { + "array": [] + } + } + ] + }, + { + "document": [ + { + "name": "flowerFieldA", + "value": { + "array": [] + } + }, + { + "name": "flowerFieldB", + "value": { + "array": [ + { + "text": "rose" + } + ] + } + }, + { + "name": "allValues", + "value": { + "array": [ + { + "text": "rose" + } + ] + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [ + "PROJECT_ID_FIRST" + ], + "ignore": [], + "unorderedArrays": [ + "/allValues" + ], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/action.json deleted file mode 100644 index e8d8abb44b2..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/action.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - $addFields : { - "side_b" : { - $multiply : [ - { $sin : {$degreesToRadians : "$angle_a"} }, - "$hypotenuse" - ] - } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/data.json deleted file mode 100644 index af945b0af3f..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/data.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("53.13010235415597870314438744090659"), "hypotenuse" : NumberDecimal("5")} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/expected.json deleted file mode 100644 index e664ca1cbfd..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("53.13010235415597870314438744090659"), "side_b" : NumberDecimal("4.000000000000000000000000000000000"), "hypotenuse" : NumberDecimal("5"),} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/name deleted file mode 100644 index bab75a71511..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/name +++ /dev/null @@ -1 +0,0 @@ -main :: Sine of Value in Degrees \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json new file mode 100644 index 00000000000..e0407425e7f --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json @@ -0,0 +1,98 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/sin/sineOfValueInDegrees", + "title": "main :: Sine of Value in Degrees", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "8562c94b38de3e8c83552bcd41558548e5220eef", + "path": "source/reference/operator/aggregation/sin.txt", + "blob": "2bea14aa7ebe97bf5e22cb59839ed118a3fc32fd" + }, + "dataset": null, + "collections": { + "trigonometry": [ + { + "_id": { + "$oid": "5c50782193f833234ba90d85" + }, + "angle_a": { + "$numberDecimal": "53.13010235415597870314438744090659" + }, + "hypotenuse": { + "$numberDecimal": "5" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "trigonometry", + "pipeline": [ + { + "$addFields": { + "side_b": { + "$multiply": [ + { + "$sin": { + "$degreesToRadians": "$angle_a" + } + }, + "$hypotenuse" + ] + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "exact": { + "$oid": "5c50782193f833234ba90d85" + } + } + }, + { + "name": "angle_a", + "value": { + "decimal": "53.13010235415597870314438744090659" + } + }, + { + "name": "side_b", + "value": { + "decimal": "4.000000000000000000000000000000000" + } + }, + { + "name": "hypotenuse", + "value": { + "decimal": "5" + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/action.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/action.json deleted file mode 100644 index 423d472516f..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/action.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - $addFields : { - "side_b" : { - $multiply : [ - { $sin : "$angle_a" }, - "$hypotenuse" - ] - } - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/data.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/data.json deleted file mode 100644 index df0c36c7819..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/data.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("0.9272952180016122324285124629224288"), "hypotenuse" : NumberDecimal("5")} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/expected.json deleted file mode 100644 index 219a00c58e6..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : ObjectId("5c50782193f833234ba90d85"), "angle_a" : NumberDecimal("0.9272952180016122324285124629224288"), "side_b" : NumberDecimal("4.000000000000000000000000000000000"), "hypotenuse" : NumberDecimal("5"),} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/name b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/name deleted file mode 100644 index 77597ccfd1b..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/name +++ /dev/null @@ -1 +0,0 @@ -main :: Sine of Value in Radians \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json new file mode 100644 index 00000000000..80a8d7534dc --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json @@ -0,0 +1,96 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/expressions/sin/sineOfValueInRadians", + "title": "main :: Sine of Value in Radians", + "context": "EXPRESSION", + "source": { + "repository": "mongodb/docs", + "commit": "8562c94b38de3e8c83552bcd41558548e5220eef", + "path": "source/reference/operator/aggregation/sin.txt", + "blob": "2bea14aa7ebe97bf5e22cb59839ed118a3fc32fd" + }, + "dataset": null, + "collections": { + "trigonometry": [ + { + "_id": { + "$oid": "5c50782193f833234ba90d85" + }, + "angle_a": { + "$numberDecimal": "0.9272952180016122324285124629224288" + }, + "hypotenuse": { + "$numberDecimal": "5" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "trigonometry", + "pipeline": [ + { + "$addFields": { + "side_b": { + "$multiply": [ + { + "$sin": "$angle_a" + }, + "$hypotenuse" + ] + } + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "exact": { + "$oid": "5c50782193f833234ba90d85" + } + } + }, + { + "name": "angle_a", + "value": { + "decimal": "0.9272952180016122324285124629224288" + } + }, + { + "name": "side_b", + "value": { + "decimal": "4.000000000000000000000000000000000" + } + }, + { + "name": "hypotenuse", + "value": { + "decimal": "5" + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the field $addFields adds before an existing one; $addFields writes a new field after the document's existing fields, which is what the server returns; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/action.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/action.json deleted file mode 100644 index f9abda38dc7..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/action.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - $facet: { - "price": [ - { - $bucketAuto: { - groupBy: "$price", - buckets: 4 - } - } - ], - "year": [ - { - $bucketAuto: { - groupBy: "$year", - buckets: 3, - output: { - "count": { $sum: 1 }, - "years": { $push: "$year" } - } - } - } - ], - "area": [ - { - $bucketAuto: { - groupBy: { - $multiply: [ "$dimensions.height", "$dimensions.width" ] - }, - buckets: 4, - output: { - "count": { $sum: 1 }, - "titles": { $push: "$title" } - } - } - } - ] - } - } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/data.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/data.json deleted file mode 100644 index f8e09c158dc..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ "_id" : 1, "title" : "The Pillars of Society", "artist" : "Grosz", "year" : 1926, "price" : NumberDecimal("199.99"), "dimensions" : { "height" : 39, "width" : 21, "units" : "in" } } -{ "_id" : 2, "title" : "Melancholy III", "artist" : "Munch", "year" : 1902, "price" : NumberDecimal("280.00"), "dimensions" : { "height" : 49, "width" : 32, "units" : "in" } } -{ "_id" : 3, "title" : "Dancer", "artist" : "Miro", "year" : 1925, "price" : NumberDecimal("76.04"), "dimensions" : { "height" : 25, "width" : 20, "units" : "in" } } -{ "_id" : 4, "title" : "The Great Wave off Kanagawa", "artist" : "Hokusai", "price" : NumberDecimal("167.30"), "dimensions" : { "height" : 24, "width" : 36, "units" : "in" } } -{ "_id" : 5, "title" : "The Persistence of Memory", "artist" : "Dali", "year" : 1931, "price" : NumberDecimal("483.00"), "dimensions" : { "height" : 20, "width" : 24, "units" : "in" } } -{ "_id" : 6, "title" : "Composition VII", "artist" : "Kandinsky", "year" : 1913, "price" : NumberDecimal("385.00"), "dimensions" : { "height" : 30, "width" : 46, "units" : "in" } } -{ "_id" : 7, "title" : "The Scream", "artist" : "Munch", "price" : NumberDecimal("159.00"), "dimensions" : { "height" : 24, "width" : 18, "units" : "in" } } -{ "_id" : 8, "title" : "Blue Flower", "artist" : "O'Keefe", "year" : 1918, "price" : NumberDecimal("118.42"), "dimensions" : { "height" : 24, "width" : 20, "units" : "in" } } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/expected.json deleted file mode 100644 index 7600ba90b41..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "area" : [ { "_id" : { "min" : 432, "max" : 500 }, "count" : 3, "titles" : [ "The Scream", "The Persistence of Memory", "Blue Flower" ] }, { "_id" : { "min" : 500, "max" : 864 }, "count" : 2, "titles" : [ "Dancer", "The Pillars of Society" ] }, { "_id" : { "min" : 864, "max" : 1568 }, "count" : 2, "titles" : [ "The Great Wave off Kanagawa", "Composition VII" ] }, { "_id" : { "min" : 1568, "max" : 1568 }, "count" : 1, "titles" : [ "Melancholy III" ] } ], "price" : [ { "_id" : { "min" : NumberDecimal("76.04"), "max" : NumberDecimal("159.00") }, "count" : 2 }, { "_id" : { "min" : NumberDecimal("159.00"), "max" : NumberDecimal("199.99") }, "count" : 2 }, { "_id" : { "min" : NumberDecimal("199.99"), "max" : NumberDecimal("385.00") }, "count" : 2 }, { "_id" : { "min" : NumberDecimal("385.00"), "max" : NumberDecimal("483.00") }, "count" : 2 } ], "year" : [ { "_id" : { "min" : null, "max" : 1913 }, "count" : 3, "years" : [ 1902 ] }, { "_id" : { "min" : 1913, "max" : 1926 }, "count" : 3, "years" : [ 1913, 1918, 1925 ] }, { "_id" : { "min" : 1926, "max" : 1931 }, "count" : 2, "years" : [ 1926, 1931 ] } ]} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/name b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/name deleted file mode 100644 index 6066b3dbbde..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/name +++ /dev/null @@ -1 +0,0 @@ -Multi-Faceted Aggregation \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json new file mode 100644 index 00000000000..46fe09dbce4 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json @@ -0,0 +1,767 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/stages/bucketAuto/multiFacetedAggregation", + "title": "Multi-Faceted Aggregation", + "context": "STAGE", + "source": { + "repository": "mongodb/docs", + "commit": "ab1ddea48c5a51dc16b4672f276f6b6c6b132ff0", + "path": "source/reference/operator/aggregation/bucketAuto.txt", + "blob": "3b07c7071063998d64970ee0626c4e334f7a7091" + }, + "dataset": null, + "collections": { + "artwork": [ + { + "_id": { + "$numberInt": "1" + }, + "title": "The Pillars of Society", + "artist": "Grosz", + "year": { + "$numberInt": "1926" + }, + "price": { + "$numberDecimal": "199.99" + }, + "dimensions": { + "height": { + "$numberInt": "39" + }, + "width": { + "$numberInt": "21" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "title": "Melancholy III", + "artist": "Munch", + "year": { + "$numberInt": "1902" + }, + "price": { + "$numberDecimal": "280.00" + }, + "dimensions": { + "height": { + "$numberInt": "49" + }, + "width": { + "$numberInt": "32" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "title": "Dancer", + "artist": "Miro", + "year": { + "$numberInt": "1925" + }, + "price": { + "$numberDecimal": "76.04" + }, + "dimensions": { + "height": { + "$numberInt": "25" + }, + "width": { + "$numberInt": "20" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "title": "The Great Wave off Kanagawa", + "artist": "Hokusai", + "price": { + "$numberDecimal": "167.30" + }, + "dimensions": { + "height": { + "$numberInt": "24" + }, + "width": { + "$numberInt": "36" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "title": "The Persistence of Memory", + "artist": "Dali", + "year": { + "$numberInt": "1931" + }, + "price": { + "$numberDecimal": "483.00" + }, + "dimensions": { + "height": { + "$numberInt": "20" + }, + "width": { + "$numberInt": "24" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "title": "Composition VII", + "artist": "Kandinsky", + "year": { + "$numberInt": "1913" + }, + "price": { + "$numberDecimal": "385.00" + }, + "dimensions": { + "height": { + "$numberInt": "30" + }, + "width": { + "$numberInt": "46" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "title": "The Scream", + "artist": "Munch", + "price": { + "$numberDecimal": "159.00" + }, + "dimensions": { + "height": { + "$numberInt": "24" + }, + "width": { + "$numberInt": "18" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "title": "Blue Flower", + "artist": "O'Keefe", + "year": { + "$numberInt": "1918" + }, + "price": { + "$numberDecimal": "118.42" + }, + "dimensions": { + "height": { + "$numberInt": "24" + }, + "width": { + "$numberInt": "20" + }, + "units": "in" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "artwork", + "pipeline": [ + { + "$facet": { + "price": [ + { + "$bucketAuto": { + "groupBy": "$price", + "buckets": { + "$numberInt": "4" + } + } + } + ], + "year": [ + { + "$bucketAuto": { + "groupBy": "$year", + "buckets": { + "$numberInt": "3" + }, + "output": { + "count": { + "$sum": { + "$numberInt": "1" + } + }, + "years": { + "$push": "$year" + } + } + } + } + ], + "area": [ + { + "$bucketAuto": { + "groupBy": { + "$multiply": [ + "$dimensions.height", + "$dimensions.width" + ] + }, + "buckets": { + "$numberInt": "4" + }, + "output": { + "count": { + "$sum": { + "$numberInt": "1" + } + }, + "titles": { + "$push": "$title" + } + } + } + } + ] + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "area", + "value": { + "array": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "432" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "500" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "The Scream" + }, + { + "text": "The Persistence of Memory" + }, + { + "text": "Blue Flower" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "500" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "864" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "Dancer" + }, + { + "text": "The Pillars of Society" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "864" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1568" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "The Great Wave off Kanagawa" + }, + { + "text": "Composition VII" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "1568" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1568" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "Melancholy III" + } + ] + } + } + ] + } + ] + } + }, + { + "name": "price", + "value": { + "array": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "76.04" + } + }, + { + "name": "max", + "value": { + "decimal": "159.00" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "159.00" + } + }, + { + "name": "max", + "value": { + "decimal": "199.99" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "199.99" + } + }, + { + "name": "max", + "value": { + "decimal": "385.00" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "385.00" + } + }, + { + "name": "max", + "value": { + "decimal": "483.00" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + } + ] + } + }, + { + "name": "year", + "value": { + "array": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "exact": null + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1913" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "years", + "value": { + "array": [ + { + "whole": { + "$numberInt": "1902" + } + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "1913" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1926" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "years", + "value": { + "array": [ + { + "whole": { + "$numberInt": "1913" + } + }, + { + "whole": { + "$numberInt": "1918" + } + }, + { + "whole": { + "$numberInt": "1925" + } + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "1926" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1931" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "years", + "value": { + "array": [ + { + "whole": { + "$numberInt": "1926" + } + }, + { + "whole": { + "$numberInt": "1931" + } + } + ] + } + } + ] + } + ] + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the facets as area, price, year; $facet returns them in the pipeline's order, price, year, area; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/action.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/action.json deleted file mode 100644 index 94ceda2af2b..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/action.json +++ /dev/null @@ -1,40 +0,0 @@ - [ - { - $facet: { - "price": [ - { - $bucketAuto: { - groupBy: "$price", - buckets: 4 - } - } - ], - "year": [ - { - $bucketAuto: { - groupBy: "$year", - buckets: 3, - output: { - "count": { $sum: 1 }, - "years": { $push: "$year" } - } - } - } - ], - "area": [ - { - $bucketAuto: { - groupBy: { - $multiply: [ "$dimensions.height", "$dimensions.width" ] - }, - buckets: 4, - output: { - "count": { $sum: 1 }, - "titles": { $push: "$title" } - } - } - } - ] - } - } -] \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/data.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/data.json deleted file mode 100644 index 7967cb89438..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ "_id" : 1, "title" : "The Pillars of Society", "artist" : "Grosz", "year" : 1926, "price" : NumberDecimal("199.99"), "dimensions" : { "height" : 39, "width" : 21, "units" : "in" } } -{ "_id" : 2, "title" : "Melancholy III", "artist" : "Munch", "year" : 1902, "price" : NumberDecimal("280.00"), "dimensions" : { "height" : 49, "width" : 32, "units" : "in" } } -{ "_id" : 3, "title" : "Dancer", "artist" : "Miro", "year" : 1925, "price" : NumberDecimal("76.04"), "dimensions" : { "height" : 25, "width" : 20, "units" : "in" } } -{ "_id" : 4, "title" : "The Great Wave off Kanagawa", "artist" : "Hokusai", "price" : NumberDecimal("167.30"), "dimensions" : { "height" : 24, "width" : 36, "units" : "in" } } -{ "_id" : 5, "title" : "The Persistence of Memory", "artist" : "Dali", "year" : 1931, "price" : NumberDecimal("483.00"), "dimensions" : { "height" : 20, "width" : 24, "units" : "in" } } -{ "_id" : 6, "title" : "Composition VII", "artist" : "Kandinsky", "year" : 1913, "price" : NumberDecimal("385.00"), "dimensions" : { "height" : 30, "width" : 46, "units" : "in" } } -{ "_id" : 7, "title" : "The Scream", "artist" : "Munch", "price" : NumberDecimal("159.00"), "dimensions" : { "height" : 24, "width" : 18, "units" : "in" } } -{ "_id" : 8, "title" : "Blue Flower", "artist" : "O'Keefe", "year" : 1918, "price" : NumberDecimal("118.42"), "dimensions" : { "height" : 24, "width" : 20, "units" : "in" } } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/expected.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/expected.json deleted file mode 100644 index 501ec03b4c9..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "area" : [ { "_id" : { "min" : 432, "max" : 500 }, "count" : 3, "titles" : [ "The Scream", "The Persistence of Memory", "Blue Flower" ] }, { "_id" : { "min" : 500, "max" : 864 }, "count" : 2, "titles" : [ "Dancer", "The Pillars of Society" ] }, { "_id" : { "min" : 864, "max" : 1568 }, "count" : 2, "titles" : [ "The Great Wave off Kanagawa", "Composition VII" ] }, { "_id" : { "min" : 1568, "max" : 1568 }, "count" : 1, "titles" : [ "Melancholy III" ] } ], "price" : [ { "_id" : { "min" : NumberDecimal("76.04"), "max" : NumberDecimal("159.00") }, "count" : 2 }, { "_id" : { "min" : NumberDecimal("159.00"), "max" : NumberDecimal("199.99") }, "count" : 2 }, { "_id" : { "min" : NumberDecimal("199.99"), "max" : NumberDecimal("385.00") }, "count" : 2 }, { "_id" : { "min" : NumberDecimal("385.00"), "max" : NumberDecimal("483.00") }, "count" : 2 } ], "year" : [ { "_id" : { "min" : null, "max" : 1913 }, "count" : 3, "years" : [ 1902 ] }, { "_id" : { "min" : 1913, "max" : 1926 }, "count" : 3, "years" : [ 1913, 1918, 1925 ] }, { "_id" : { "min" : 1926, "max" : 1931 }, "count" : 2, "years" : [ 1926, 1931 ] } ]} \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/name b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/name deleted file mode 100644 index 6066b3dbbde..00000000000 --- a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/name +++ /dev/null @@ -1 +0,0 @@ -Multi-Faceted Aggregation \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json new file mode 100644 index 00000000000..fd65664b024 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json @@ -0,0 +1,767 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline", + "title": "Multi-Faceted Aggregation", + "context": "STAGE", + "source": { + "repository": "mongodb/docs", + "commit": "ab1ddea48c5a51dc16b4672f276f6b6c6b132ff0", + "path": "source/reference/operator/aggregation/bucketAuto.txt", + "blob": "3b07c7071063998d64970ee0626c4e334f7a7091" + }, + "dataset": null, + "collections": { + "artwork": [ + { + "_id": { + "$numberInt": "1" + }, + "title": "The Pillars of Society", + "artist": "Grosz", + "year": { + "$numberInt": "1926" + }, + "price": { + "$numberDecimal": "199.99" + }, + "dimensions": { + "height": { + "$numberInt": "39" + }, + "width": { + "$numberInt": "21" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "title": "Melancholy III", + "artist": "Munch", + "year": { + "$numberInt": "1902" + }, + "price": { + "$numberDecimal": "280.00" + }, + "dimensions": { + "height": { + "$numberInt": "49" + }, + "width": { + "$numberInt": "32" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "title": "Dancer", + "artist": "Miro", + "year": { + "$numberInt": "1925" + }, + "price": { + "$numberDecimal": "76.04" + }, + "dimensions": { + "height": { + "$numberInt": "25" + }, + "width": { + "$numberInt": "20" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "title": "The Great Wave off Kanagawa", + "artist": "Hokusai", + "price": { + "$numberDecimal": "167.30" + }, + "dimensions": { + "height": { + "$numberInt": "24" + }, + "width": { + "$numberInt": "36" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "title": "The Persistence of Memory", + "artist": "Dali", + "year": { + "$numberInt": "1931" + }, + "price": { + "$numberDecimal": "483.00" + }, + "dimensions": { + "height": { + "$numberInt": "20" + }, + "width": { + "$numberInt": "24" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "title": "Composition VII", + "artist": "Kandinsky", + "year": { + "$numberInt": "1913" + }, + "price": { + "$numberDecimal": "385.00" + }, + "dimensions": { + "height": { + "$numberInt": "30" + }, + "width": { + "$numberInt": "46" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "title": "The Scream", + "artist": "Munch", + "price": { + "$numberDecimal": "159.00" + }, + "dimensions": { + "height": { + "$numberInt": "24" + }, + "width": { + "$numberInt": "18" + }, + "units": "in" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "title": "Blue Flower", + "artist": "O'Keefe", + "year": { + "$numberInt": "1918" + }, + "price": { + "$numberDecimal": "118.42" + }, + "dimensions": { + "height": { + "$numberInt": "24" + }, + "width": { + "$numberInt": "20" + }, + "units": "in" + } + } + ] + }, + "indexes": [], + "action": { + "kind": "aggregate", + "collection": "artwork", + "pipeline": [ + { + "$facet": { + "price": [ + { + "$bucketAuto": { + "groupBy": "$price", + "buckets": { + "$numberInt": "4" + } + } + } + ], + "year": [ + { + "$bucketAuto": { + "groupBy": "$year", + "buckets": { + "$numberInt": "3" + }, + "output": { + "count": { + "$sum": { + "$numberInt": "1" + } + }, + "years": { + "$push": "$year" + } + } + } + } + ], + "area": [ + { + "$bucketAuto": { + "groupBy": { + "$multiply": [ + "$dimensions.height", + "$dimensions.width" + ] + }, + "buckets": { + "$numberInt": "4" + }, + "output": { + "count": { + "$sum": { + "$numberInt": "1" + } + }, + "titles": { + "$push": "$title" + } + } + } + } + ] + } + } + ] + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "area", + "value": { + "array": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "432" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "500" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "The Scream" + }, + { + "text": "The Persistence of Memory" + }, + { + "text": "Blue Flower" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "500" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "864" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "Dancer" + }, + { + "text": "The Pillars of Society" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "864" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1568" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "The Great Wave off Kanagawa" + }, + { + "text": "Composition VII" + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "1568" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1568" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "titles", + "value": { + "array": [ + { + "text": "Melancholy III" + } + ] + } + } + ] + } + ] + } + }, + { + "name": "price", + "value": { + "array": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "76.04" + } + }, + { + "name": "max", + "value": { + "decimal": "159.00" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "159.00" + } + }, + { + "name": "max", + "value": { + "decimal": "199.99" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "199.99" + } + }, + { + "name": "max", + "value": { + "decimal": "385.00" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "decimal": "385.00" + } + }, + { + "name": "max", + "value": { + "decimal": "483.00" + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + } + ] + } + ] + } + }, + { + "name": "year", + "value": { + "array": [ + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "exact": null + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1913" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "years", + "value": { + "array": [ + { + "whole": { + "$numberInt": "1902" + } + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "1913" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1926" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "years", + "value": { + "array": [ + { + "whole": { + "$numberInt": "1913" + } + }, + { + "whole": { + "$numberInt": "1918" + } + }, + { + "whole": { + "$numberInt": "1925" + } + } + ] + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "document": [ + { + "name": "min", + "value": { + "whole": { + "$numberInt": "1926" + } + } + }, + { + "name": "max", + "value": { + "whole": { + "$numberInt": "1931" + } + } + } + ] + } + }, + { + "name": "count", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "years", + "value": { + "array": [ + { + "whole": { + "$numberInt": "1926" + } + }, + { + "whole": { + "$numberInt": "1931" + } + } + ] + } + } + ] + } + ] + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + }, + "skipped": { + "published": "a page error: the page prints the facets as area, price, year; $facet returns them in the pipeline's order, price, year, area; serialization and behavior pass" + } +} diff --git a/core/src/test/resources/dev/morphia/test/generated/manifest.json b/core/src/test/resources/dev/morphia/test/generated/manifest.json index 108b8a3f1ff..e552b17fc18 100644 --- a/core/src/test/resources/dev/morphia/test/generated/manifest.json +++ b/core/src/test/resources/dev/morphia/test/generated/manifest.json @@ -39,6 +39,11 @@ "name" : "aggregation/expressions/addToSet/collectTheGenresOfEachDirector", "scenario" : "/dev/morphia/test/generated/fixtures/expressions/addToSet/collectTheGenresOfEachDirector/scenario.json", "test" : "dev.morphia.test.generated.expressions.TestAddToSet#collectTheGenresOfEachDirector" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/addToSet/useInGroupStage", + "scenario" : "/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestAddToSet#testUseInGroupStage" }, { "kind" : "CONVERTED", "name" : "aggregation/expressions/and/andExpressionOperator", @@ -219,6 +224,16 @@ "name" : "aggregation/expressions/cond/condExpressionOperator", "scenario" : "/dev/morphia/test/aggregation/expressions/cond/condExpressionOperator/scenario.json", "test" : "dev.morphia.test.aggregation.expressions.TestCond#testCondExpressionOperator" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/cos/cosineOfValueInDegrees", + "scenario" : "/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestCos#testCosineOfValueInDegrees" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/cos/cosineOfValueInRadians", + "scenario" : "/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestCos#testCosineOfValueInRadians" }, { "kind" : "CONVERTED", "name" : "aggregation/expressions/cosh/hyperbolicCosineInDegrees", @@ -424,6 +439,16 @@ "name" : "aggregation/expressions/getField/queryAFieldInASubDocument", "scenario" : "/dev/morphia/test/aggregation/expressions/getField/queryAFieldInASubDocument/scenario.json", "test" : "dev.morphia.test.aggregation.expressions.TestGetField#testQueryAFieldInASubDocument" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/getField/queryFieldsThatContainPeriods", + "scenario" : "/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestGetField#testQueryFieldsThatContainPeriods" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/getField/queryFieldsThatStartWithADollarSign", + "scenario" : "/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestGetField#testQueryFieldsThatStartWithADollarSign" }, { "kind" : "CONVERTED", "name" : "aggregation/expressions/gt/gtExpressionOperator", @@ -479,6 +504,11 @@ "name" : "aggregation/expressions/isoWeek/isoWeekExpressionOperator", "scenario" : "/dev/morphia/test/aggregation/expressions/isoWeek/isoWeekExpressionOperator/scenario.json", "test" : "dev.morphia.test.aggregation.expressions.TestIsoWeek#testIsoWeekExpressionOperator" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator", + "scenario" : "/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestIsoWeekYear#testIsoWeekYearExpressionOperator" }, { "kind" : "CONVERTED", "name" : "aggregation/expressions/last/useInGroupStage", @@ -909,6 +939,11 @@ "name" : "aggregation/expressions/setIsSubset/setIsSubsetExpressionOperator", "scenario" : "/dev/morphia/test/aggregation/expressions/setIsSubset/setIsSubsetExpressionOperator/scenario.json", "test" : "dev.morphia.test.aggregation.expressions.TestSetIsSubset#testSetIsSubsetExpressionOperator" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/setUnion/setUnionAccumulatorOperator", + "scenario" : "/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestSetUnion#testSetUnionAccumulatorOperator" }, { "kind" : "CONVERTED", "name" : "aggregation/expressions/shift/shiftUsingANegativeInteger", @@ -919,6 +954,16 @@ "name" : "aggregation/expressions/shift/shiftUsingAPositiveInteger", "scenario" : "/dev/morphia/test/aggregation/expressions/shift/shiftUsingAPositiveInteger/scenario.json", "test" : "dev.morphia.test.aggregation.expressions.TestShift#testShiftUsingAPositiveInteger" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/sin/sineOfValueInDegrees", + "scenario" : "/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestSin#testSineOfValueInDegrees" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/expressions/sin/sineOfValueInRadians", + "scenario" : "/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json", + "test" : "dev.morphia.test.aggregation.expressions.TestSin#testSineOfValueInRadians" }, { "kind" : "CONVERTED", "name" : "aggregation/expressions/sinh/hyperbolicSineOfValueInDegrees", @@ -1224,6 +1269,16 @@ "name" : "aggregation/stages/bucket/useBucketWithFacetToBucketByMultipleFields", "scenario" : "/dev/morphia/test/aggregation/stages/bucket/useBucketWithFacetToBucketByMultipleFields/scenario.json", "test" : "dev.morphia.test.aggregation.stages.TestBucket#testUseBucketWithFacetToBucketByMultipleFields" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/stages/bucketAuto/multiFacetedAggregation", + "scenario" : "/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json", + "test" : "dev.morphia.test.aggregation.stages.TestBucketAuto#testMultiFacetedAggregation" + }, { + "kind" : "CONVERTED", + "name" : "aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline", + "scenario" : "/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json", + "test" : "dev.morphia.test.aggregation.stages.TestBucketAuto#testMultiFacetedAggregationAsPipeline" }, { "kind" : "CONVERTED", "name" : "aggregation/stages/bucketAuto/singleFacetAggregation", @@ -2183,6 +2238,10 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/add/addNumbers/scenario.json", "sha256" : "1a7c2c3e8e6ad1f9ccbe6d55847da58dfe4604d7afeb47cfe8cc99c359f4f340" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/addToSet/useInGroupStage/scenario.json", + "sha256" : "56903351e0d1dc2c8346a6e2bee4cbbd6861f189ccd597a37fdca95de360316e" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/and/andExpressionOperator/scenario.json", @@ -2307,6 +2366,14 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/cond/condExpressionOperator/scenario.json", "sha256" : "db6dfe2a12f2a75851d0c6e3ccf4f4d137adb5daca4e6f182caf2f0a9cf39dca" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInDegrees/scenario.json", + "sha256" : "4a989c56ad10af1e05c469e24af37a9805a1dac319d5ea750cf82254f1f75d0b" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/cos/cosineOfValueInRadians/scenario.json", + "sha256" : "0456d40920e835632f5e721daae74e3f70440bb73a99e124a59df0abfacf2768" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/cosh/hyperbolicCosineInDegrees/scenario.json", @@ -2459,6 +2526,14 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryAFieldInASubDocument/scenario.json", "sha256" : "4e4f13cc79539a1ddc3017b0e2c91dff1e1cf957611aa15afef1386b722d85d9" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatContainPeriods/scenario.json", + "sha256" : "22c7c116b72d0256245f63016d59740d3be0366b3e94a7f27e8ee2a96f592b35" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/getField/queryFieldsThatStartWithADollarSign/scenario.json", + "sha256" : "81af7013819861d875108a8370dcb305faa23e81146ed7e5d0b3cac09bbb2c70" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/gt/gtExpressionOperator/scenario.json", @@ -2503,6 +2578,10 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/isoWeek/isoWeekExpressionOperator/scenario.json", "sha256" : "321c11e7e6ff0827f0bdf124c01f3db4c075efa5b9c5f45447c3758e06d0def6" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/isoWeekYear/isoWeekYearExpressionOperator/scenario.json", + "sha256" : "d327648b3917ff83c74271a7ea36b5f132e12d169d9bbfd8cfadf7d049f9027a" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/last/useInGroupStage/scenario.json", @@ -2819,6 +2898,10 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/setIsSubset/setIsSubsetExpressionOperator/scenario.json", "sha256" : "28249d4a3cb6fa2a39597236da8cc74a984c8e875db5f04c45a69fc3764d8480" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/setUnion/setUnionAccumulatorOperator/scenario.json", + "sha256" : "4b3a9060e0676e65686562eac67186e9e0462cd1dd1eac814f09259b41766da7" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/shift/shiftUsingANegativeInteger/scenario.json", @@ -2827,6 +2910,14 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/shift/shiftUsingAPositiveInteger/scenario.json", "sha256" : "9119adbfb5daaf4a12e0202158d6f961b333cc21349eda1b3f8a89f469a1c47c" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInDegrees/scenario.json", + "sha256" : "caa8945bbabdde910c4b33185ee7bd1762883bab6ed3133f45080c2cdb8015da" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/sin/sineOfValueInRadians/scenario.json", + "sha256" : "f2268619e9df8203b5b73a928192c5dc0548aba6862b0e6afe0eb4cd89d7161d" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/expressions/sinh/hyperbolicSineOfValueInDegrees/scenario.json", @@ -3055,6 +3146,14 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/stages/bucket/useBucketWithFacetToBucketByMultipleFields/scenario.json", "sha256" : "fc5a9f5fc92db2f058f71d57416a0c162b9148d5bc58da42e305f3efffa0475b" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregation/scenario.json", + "sha256" : "a3f6db877bf3b9af4d5efa5ed755e23ef3d0f9c78a7621e736c33ca73ddd2778" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/multiFacetedAggregationAsPipeline/scenario.json", + "sha256" : "9cec8d232c53f0b4122c277f8b12d87d43316adef05dce727267ba913a441af8" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/aggregation/stages/bucketAuto/singleFacetAggregation/scenario.json", diff --git a/design/operator-audits-design.md b/design/operator-audits-design.md index 7724562656f..6bcc68b0608 100644 --- a/design/operator-audits-design.md +++ b/design/operator-audits-design.md @@ -114,7 +114,7 @@ A case is one documented example, described entirely by a `scenario.json` (schem | `expected` | The documented results, either exact BSON or `printed`: the constraints mongosh's printed output proves (see below). | | `comparison` | Result order, declared form rules, ignored fields, unordered arrays and tolerance. | | `requirements` | The minimum server version and topology. | -| `skipped` | Checks that do not run, each with its reason. | +| `skipped` | Checks that do not run, each with its reason: `serialization`, `results` (behavior and published), or only `published`, for a reviewed page error. | The name, not the test method's name, decides where the scenario lives. The runner never finds fixtures by method name, ordinal or stack trace. diff --git a/design/operator-audits-progress.md b/design/operator-audits-progress.md index 51c6ee768a2..d912fce146b 100644 --- a/design/operator-audits-progress.md +++ b/design/operator-audits-progress.md @@ -44,8 +44,13 @@ Step 5, generation and cutover: - **Bindings for the remaining gaps** the weekly job files as issues (today `$serializeEJSON`, `$deserializeEJSON`, `$toObject`, `$toArray`, `$hexHash`, `$percentile`, `$limit`, `$type`, a compound `$group` `_id`, `$convert` options, `$reduce` `valueAs`). -- **The remaining legacy fixtures:** 16 directories, all with a documented source: 15 legacy-only - in `cutover.json`, and `type/queryingByMultipleDataTypes`, which needs alternative commands. +- **The remaining legacy fixtures:** 5 directories, all with a documented source, and the last users + of the legacy loader: + - `tan/tangentOfValueInRadians`, `densify/densifyTimeSeriesData` and + `graphLookup/acrossMultipleCollections`: the page's printed results do not parse (page typos); + - `rand/selectRandomItemsFromACollection`: the page projects `_id` first, which a reference cannot + declare (`PROJECT_ID_FIRST`) and Morphia writes last; + - `type/queryingByMultipleDataTypes`: alternative commands, which conversion does not support. - **Deferred cutover features:** generated projections (converted cases carry theirs), update options (`arrayFilters`, `upsert`), update results as the page reads them (the whole collection, not the filter's matches), alternative commands. @@ -2708,3 +2713,18 @@ no product-documentation changes. Legacy operator AsciiDoc tables are intentiona - 12 of the exposed examples are generated now (38 generated cases); `$bitOr`'s long-and-integer example is excluded again (the page error in #4563). - Remaining legacy: 16 directories, none locked. Core: 551 operator tests under each mapper. + +## Reviewed page errors and set results (2026-11-23) + +- Branch audits-published-skips. A ledger entry may carry `publishedSkip`: a reviewed page error, + with its evidence, that skips only the published check (`skipped.published`); serialization and + behavior stay strict. `FixtureMigration.scenario(migrated)` is the one way to write a ledger + case's scenario, so every caller includes it. +- Nine cases convert with a reviewed page error: `$cos` and `$sin` ×4 (the page prints the added + field before an existing one), `$getField` ×2 (field order the page's own insert does not store), + `$isoWeekYear` (a Long printed as a plain number) and `$bucketAuto` ×2 (facets printed out of the + pipeline's order). +- `$addToSet`'s `useInGroupStage` and `$setUnion`'s accumulator case declare their set arrays + unordered instead (#4568): their behavior check could differ between runs too, and every check + stays strict. +- 384 cases on the runner; 5 legacy directories. Core: 551 under each mapper.