From feffeb6ee89731fc61d26acaa3c5dd140d7343ca Mon Sep 17 00:00:00 2001 From: evanchooly Date: Mon, 23 Nov 2026 10:22:27 -0500 Subject: [PATCH] Create the documented indexes before running a case A page's createIndex blocks lower as setup, and the scenario's indexes list each with its collection, keys and options. The runner creates them on both databases after seeding. The seven $text cases that stayed on the legacy path because their page creates a text index now convert and pass under both mappers. --- audits/README.md | 6 +- audits/catalog/cutover.json | 28 - audits/catalog/fixture-migration.json | 669 ++++++++++++++++++ .../audits/repairs/FixtureMigration.kt | 11 +- .../morphia/audits/repairs/FormMigration.kt | 56 +- .../morphia/audits/offline/GeneratorTest.kt | 13 + .../dev/morphia/test/OperatorCaseRunner.java | 37 +- .../dev/morphia/test/generated/manifest.json | 63 ++ .../caseAndDiacriticInsensitivity/action.json | 1 - .../caseAndDiacriticInsensitivity/data.json | 8 - .../expected.json | 3 - .../caseAndDiacriticInsensitivity/index.json | 1 - .../text/caseAndDiacriticInsensitivity/name | 1 - .../scenario.json | 226 ++++++ .../filters/text/caseSensitivity/action.json | 1 - .../filters/text/caseSensitivity/data.json | 8 - .../text/caseSensitivity/expected.json | 1 - .../filters/text/caseSensitivity/index.json | 1 - .../query/filters/text/caseSensitivity/name | 1 - .../text/caseSensitivity/scenario.json | 163 +++++ .../action.json | 1 - .../data.json | 8 - .../expected.json | 2 - .../index.json | 1 - .../excludeDocumentsThatContainATerm/name | 1 - .../scenario.json | 194 +++++ .../text/matchAnyOfTheSearchTerms/action.json | 1 - .../text/matchAnyOfTheSearchTerms/data.json | 8 - .../matchAnyOfTheSearchTerms/expected.json | 5 - .../text/matchAnyOfTheSearchTerms/index.json | 1 - .../text/matchAnyOfTheSearchTerms/name | 1 - .../matchAnyOfTheSearchTerms/scenario.json | 290 ++++++++ .../text/queryADifferentLanguage/action.json | 3 - .../text/queryADifferentLanguage/data.json | 8 - .../queryADifferentLanguage/expected.json | 2 - .../text/queryADifferentLanguage/index.json | 1 - .../filters/text/queryADifferentLanguage/name | 1 - .../queryADifferentLanguage/scenario.json | 195 +++++ .../text/textWithASingleWord/action.json | 1 - .../text/textWithASingleWord/data.json | 8 - .../text/textWithASingleWord/expected.json | 3 - .../text/textWithASingleWord/index.json | 1 - .../filters/text/textWithASingleWord/name | 1 - .../text/textWithASingleWord/scenario.json | 226 ++++++ .../text/textWithAnExactString/action.json | 1 - .../text/textWithAnExactString/data.json | 8 - .../text/textWithAnExactString/expected.json | 1 - .../text/textWithAnExactString/index.json | 1 - .../filters/text/textWithAnExactString/name | 1 - .../text/textWithAnExactString/scenario.json | 162 +++++ design/operator-audits-design.md | 5 +- design/operator-audits-progress.md | 18 +- 52 files changed, 2307 insertions(+), 151 deletions(-) delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/action.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/data.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/expected.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/index.json delete mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/name create mode 100644 core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json diff --git a/audits/README.md b/audits/README.md index 5db3e81ed17..dac79847978 100644 --- a/audits/README.md +++ b/audits/README.md @@ -168,11 +168,11 @@ 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 193 legacy fixture directories; 363 cases have moved to the runner. - Of the 193: + `TemplatedTestBase`). It runs 186 legacy fixture directories; 370 cases have moved to the runner. + Of the 186: - 98 are still locked: 96 have no documented source that reproduces them, and are listed under `unresolved` in `form-review.json`; - - 23 are tracked as legacy-only in `cutover.json`; + - 16 are tracked as legacy-only in `cutover.json`; - 69 never-locked fixtures have no pinned reference. - **The legacy RST extractor** (`rst/`, `model/CodeBlock`). Cutover and the example inventory read pages through it, with tested snippets spliced in and only the mongosh content of each diff --git a/audits/catalog/cutover.json b/audits/catalog/cutover.json index 278ff46532d..56360d8b379 100644 --- a/audits/catalog/cutover.json +++ b/audits/catalog/cutover.json @@ -64,34 +64,6 @@ "check" : "SOURCE", "detail" : "the page documents a projection, which needs the unmapped findOptions", "fixture" : "query/filters/nin/selectOnUnmatchingDocuments" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/caseAndDiacriticInsensitivity" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/caseSensitivity" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/excludeDocumentsThatContainATerm" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/matchAnyOfTheSearchTerms" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/queryADifferentLanguage" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/textWithASingleWord" - }, { - "check" : "SOURCE", - "detail" : "the page creates an index, which the runner does not seed yet", - "fixture" : "query/filters/text/textWithAnExactString" } ], "schemaVersion" : 1 } diff --git a/audits/catalog/fixture-migration.json b/audits/catalog/fixture-migration.json index ca12becfc33..d9a9739d936 100644 --- a/audits/catalog/fixture-migration.json +++ b/audits/catalog/fixture-migration.json @@ -21996,6 +21996,675 @@ "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/regex/extendRegexOptionsToMatchCharactersOutsideOfAscii/scenario.json", "scenarioSha256" : "4f628b36f14ba15d1ad3003a1a79889e4db218c46bb2bd861f52a91986155fb9", "test" : "dev.morphia.test.query.filters.TestRegex#testExtendRegexOptionsToMatchCharactersOutsideOfAscii" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "64ce876f0a2d0abcbfb062ede7d8cde5315a3e02bf095003d5be54740906e9a8", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "718343e8c49f48031ab03311a58dc720f7e23080a9cb1b561c1caed8e5f3a9ad", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "5bdd682a6d39e9aabc4758c0bee928a1a20274d47d04b0f2e612893b4940364f" + }, + "fixture" : "query/filters/text/caseAndDiacriticInsensitivity", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery(new ActionTestOptions().orderMatters(false), (query) -> query.filter(text(\"сы́рники CAFÉS\")));\n }", + "legacyBodySha256" : "53387f665a2ef1cb2ad7acf62a4dacb232bd7442cb4336a439fc55d1f74484a4", + "legacyMethod" : "testCaseAndDiacriticInsensitivity", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "64ce876f0a2d0abcbfb062ede7d8cde5315a3e02bf095003d5be54740906e9a8", + "text" : "db.articles.find( { $text: { $search: \"сы́рники CAFÉS\" } } )" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "718343e8c49f48031ab03311a58dc720f7e23080a9cb1b561c1caed8e5f3a9ad", + "text" : "{ \"_id\" : 6, \"subject\" : \"Сырники\", \"author\" : \"jkl\", \"views\" : 80 }\n{ \"_id\" : 5, \"subject\" : \"Café Con Leche\", \"author\" : \"abc\", \"views\" : 200 }\n{ \"_id\" : 8, \"subject\" : \"Cafe con Leche\", \"author\" : \"xyz\", \"views\" : 10 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Case and Diacritic Insensitivity", + "fixture" : "query/filters/text/caseAndDiacriticInsensitivity", + "fixtureFiles" : { + "action.json" : "64ce876f0a2d0abcbfb062ede7d8cde5315a3e02bf095003d5be54740906e9a8", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "718343e8c49f48031ab03311a58dc720f7e23080a9cb1b561c1caed8e5f3a9ad", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "5bdd682a6d39e9aabc4758c0bee928a1a20274d47d04b0f2e612893b4940364f" + }, + "includes" : [ { + "blob" : "e360d3a4c226e0d9c595ed610e494dce21b2cb47", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "e78d7ffbce773cfbca1385235582b09d9cc9a733", + "path" : "source/includes/fact-text-search-phrase-and-term.rst" + }, { + "blob" : "2eedcd0e0a4bc58be17eafd3d0856add713d5733", + "path" : "source/includes/fact-text-search-multiple-phrases.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "4e4d5dbac144984c134f2224a091f715855df525", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "f5efa7c2b14d22ec139f3ea5a0e37bca1aefa874", + "pageBlob" : "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json", + "scenarioSha256" : "23a6ed77264099ff60097e58840384f08ba1d4e7ea951530cc7effd614a57aa5", + "test" : "dev.morphia.test.query.filters.TestText#testCaseAndDiacriticInsensitivity" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "81875123377e8448b50c704360892d86ae025cc159ce43e4f045d5c167ec8892", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "29affe37b0cb096e63b63451fd47501201873d8c93861c4f26ac841586fef34e", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "aef80b17cc741ef65940378945b5c7a3615400b379cbc62b0ba13a1c1d49aea3" + }, + "fixture" : "query/filters/text/caseSensitivity", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery((query) -> query.filter(text(\"Coffee\").caseSensitive(true)));\n }", + "legacyBodySha256" : "d78054fed195f67986e6352cc4322a03fbaba97be45499a2fc370204daa95e61", + "legacyMethod" : "testCaseSensitivity", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "81875123377e8448b50c704360892d86ae025cc159ce43e4f045d5c167ec8892", + "text" : "db.articles.find( { $text: { $search: \"Coffee\", $caseSensitive: true } } )" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "29affe37b0cb096e63b63451fd47501201873d8c93861c4f26ac841586fef34e", + "text" : "{ \"_id\" : 2, \"subject\" : \"Coffee Shopping\", \"author\" : \"efg\", \"views\" : 5 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Case Sensitivity", + "fixture" : "query/filters/text/caseSensitivity", + "fixtureFiles" : { + "action.json" : "81875123377e8448b50c704360892d86ae025cc159ce43e4f045d5c167ec8892", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "29affe37b0cb096e63b63451fd47501201873d8c93861c4f26ac841586fef34e", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "aef80b17cc741ef65940378945b5c7a3615400b379cbc62b0ba13a1c1d49aea3" + }, + "includes" : [ { + "blob" : "e360d3a4c226e0d9c595ed610e494dce21b2cb47", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "e78d7ffbce773cfbca1385235582b09d9cc9a733", + "path" : "source/includes/fact-text-search-phrase-and-term.rst" + }, { + "blob" : "2eedcd0e0a4bc58be17eafd3d0856add713d5733", + "path" : "source/includes/fact-text-search-multiple-phrases.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "4e4d5dbac144984c134f2224a091f715855df525", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "f5efa7c2b14d22ec139f3ea5a0e37bca1aefa874", + "pageBlob" : "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json", + "scenarioSha256" : "ab0dbfb8650d82cf58f4c8c0c3be0b04fb175e1b286e166ee3d3555fc5f09509", + "test" : "dev.morphia.test.query.filters.TestText#testCaseSensitivity" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "f63c6366a8c1f31f0df7664200dfab26d13237401f64232be0639d7af23cb24e", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "c338efdcf5b52e249a211150d8351e9a958c82d0622ef15e8518dd3b0c825107", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "a610c041c20b6b8db55e24d60e18de91fada2cb8089568fe6c45dccd21305833" + }, + "fixture" : "query/filters/text/excludeDocumentsThatContainATerm", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery(new ActionTestOptions().orderMatters(false), (query) -> query.filter(text(\"coffee -shop\")\n\n ));\n }", + "legacyBodySha256" : "788a1e957f4b85412fb278ded4432217b9aecbb79605372ed8dd7d06b84ee40f", + "legacyMethod" : "testExcludeDocumentsThatContainATerm", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "f63c6366a8c1f31f0df7664200dfab26d13237401f64232be0639d7af23cb24e", + "text" : "db.articles.find( { $text: { $search: \"coffee -shop\" } } )" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "c338efdcf5b52e249a211150d8351e9a958c82d0622ef15e8518dd3b0c825107", + "text" : "{ \"_id\" : 7, \"subject\" : \"coffee and cream\", \"author\" : \"efg\", \"views\" : 10 }\n{ \"_id\" : 1, \"subject\" : \"coffee\", \"author\" : \"xyz\", \"views\" : 50 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Exclude Documents That Contain a Term", + "fixture" : "query/filters/text/excludeDocumentsThatContainATerm", + "fixtureFiles" : { + "action.json" : "f63c6366a8c1f31f0df7664200dfab26d13237401f64232be0639d7af23cb24e", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "c338efdcf5b52e249a211150d8351e9a958c82d0622ef15e8518dd3b0c825107", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "a610c041c20b6b8db55e24d60e18de91fada2cb8089568fe6c45dccd21305833" + }, + "includes" : [ { + "blob" : "e360d3a4c226e0d9c595ed610e494dce21b2cb47", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "e78d7ffbce773cfbca1385235582b09d9cc9a733", + "path" : "source/includes/fact-text-search-phrase-and-term.rst" + }, { + "blob" : "2eedcd0e0a4bc58be17eafd3d0856add713d5733", + "path" : "source/includes/fact-text-search-multiple-phrases.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "4e4d5dbac144984c134f2224a091f715855df525", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "f5efa7c2b14d22ec139f3ea5a0e37bca1aefa874", + "pageBlob" : "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json", + "scenarioSha256" : "c733276cfe0aef91ad6305d9c68fea17d686c2d51d7682045517d8dbc5cb279a", + "test" : "dev.morphia.test.query.filters.TestText#testExcludeDocumentsThatContainATerm" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "e31c3f035272e9f8ebfd65b067fdc4416c396b6032771bfaf98c26cc28e21317", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "408afa7415502ad24afc54b4e7731c15c3f82522a26efe36a2a79e18d80bb435", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "b33b5e757e1e52df03c65f3fc079370ace038897994f030e69cf1e7b71afae27" + }, + "fixture" : "query/filters/text/matchAnyOfTheSearchTerms", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery(new ActionTestOptions().orderMatters(false), (query) -> query.filter(text(\"bake coffee cake\")\n\n ));\n }", + "legacyBodySha256" : "d1c111eb147c368044d4715b3795034d7bf43545f2b6eb971732f786dc9cba1e", + "legacyMethod" : "testMatchAnyOfTheSearchTerms", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "e31c3f035272e9f8ebfd65b067fdc4416c396b6032771bfaf98c26cc28e21317", + "text" : "db.articles.find( { $text: { $search: \"bake coffee cake\" } } )" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "408afa7415502ad24afc54b4e7731c15c3f82522a26efe36a2a79e18d80bb435", + "text" : "{ \"_id\" : 2, \"subject\" : \"Coffee Shopping\", \"author\" : \"efg\", \"views\" : 5 }\n{ \"_id\" : 7, \"subject\" : \"coffee and cream\", \"author\" : \"efg\", \"views\" : 10 }\n{ \"_id\" : 1, \"subject\" : \"coffee\", \"author\" : \"xyz\", \"views\" : 50 }\n{ \"_id\" : 3, \"subject\" : \"Baking a cake\", \"author\" : \"abc\", \"views\" : 90 }\n{ \"_id\" : 4, \"subject\" : \"baking\", \"author\" : \"xyz\", \"views\" : 100 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Match Any of the ``$search`` Terms", + "fixture" : "query/filters/text/matchAnyOfTheSearchTerms", + "fixtureFiles" : { + "action.json" : "e31c3f035272e9f8ebfd65b067fdc4416c396b6032771bfaf98c26cc28e21317", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "408afa7415502ad24afc54b4e7731c15c3f82522a26efe36a2a79e18d80bb435", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "b33b5e757e1e52df03c65f3fc079370ace038897994f030e69cf1e7b71afae27" + }, + "includes" : [ { + "blob" : "e360d3a4c226e0d9c595ed610e494dce21b2cb47", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "e78d7ffbce773cfbca1385235582b09d9cc9a733", + "path" : "source/includes/fact-text-search-phrase-and-term.rst" + }, { + "blob" : "2eedcd0e0a4bc58be17eafd3d0856add713d5733", + "path" : "source/includes/fact-text-search-multiple-phrases.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "4e4d5dbac144984c134f2224a091f715855df525", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "f5efa7c2b14d22ec139f3ea5a0e37bca1aefa874", + "pageBlob" : "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json", + "scenarioSha256" : "c57491c7d383c8f957cc749980aaecdc30cbe5c0fcdcb99c7dab6f8acf6072fd", + "test" : "dev.morphia.test.query.filters.TestText#testMatchAnyOfTheSearchTerms" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "b9fa3bb02ae56a01124621a33abb033306af366975ab1a2d7ffc98ea1e1b317b", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "67bee3face0b1f9582831ea3d3e2f4b19201a703cf0cfd91c56407f21d503785", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "1b8f71f920c4d7eaedf806b1d42866a730fc23727fdd5bb2fb8c99f9e91a71e4" + }, + "fixture" : "query/filters/text/queryADifferentLanguage", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery(new ActionTestOptions().orderMatters(false), (query) -> query.filter(text(\"leche\").language(\"es\")));\n }", + "legacyBodySha256" : "4bba74f04084a7c2abf143270482831efae7188094ff243a52e8b92b8246b6b6", + "legacyMethod" : "testQueryADifferentLanguage", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "b9fa3bb02ae56a01124621a33abb033306af366975ab1a2d7ffc98ea1e1b317b", + "text" : "db.articles.find(\n { $text: { $search: \"leche\", $language: \"es\" } }\n)" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "67bee3face0b1f9582831ea3d3e2f4b19201a703cf0cfd91c56407f21d503785", + "text" : "{ \"_id\" : 5, \"subject\" : \"Café Con Leche\", \"author\" : \"abc\", \"views\" : 200 }\n{ \"_id\" : 8, \"subject\" : \"Cafe con Leche\", \"author\" : \"xyz\", \"views\" : 10 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "Query a Different Language", + "fixture" : "query/filters/text/queryADifferentLanguage", + "fixtureFiles" : { + "action.json" : "b9fa3bb02ae56a01124621a33abb033306af366975ab1a2d7ffc98ea1e1b317b", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "67bee3face0b1f9582831ea3d3e2f4b19201a703cf0cfd91c56407f21d503785", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "1b8f71f920c4d7eaedf806b1d42866a730fc23727fdd5bb2fb8c99f9e91a71e4" + }, + "includes" : [ { + "blob" : "e360d3a4c226e0d9c595ed610e494dce21b2cb47", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "e78d7ffbce773cfbca1385235582b09d9cc9a733", + "path" : "source/includes/fact-text-search-phrase-and-term.rst" + }, { + "blob" : "2eedcd0e0a4bc58be17eafd3d0856add713d5733", + "path" : "source/includes/fact-text-search-multiple-phrases.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "4e4d5dbac144984c134f2224a091f715855df525", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "f5efa7c2b14d22ec139f3ea5a0e37bca1aefa874", + "pageBlob" : "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json", + "scenarioSha256" : "f96a5fc66dd8a48fa6ffcaa220857295d31e777347cf7c8f0d3adadffa7506e5", + "test" : "dev.morphia.test.query.filters.TestText#testQueryADifferentLanguage" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "4096e690343505113ac79cba32d028a8b1bef4d79e573161c6b1fd8b35852c52", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "1b2f58f67b6e2f3e810d1d89443973e036e603097e2ed1a0a6c891fa2c1e4efc", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "50330365b7bc2bdaef5c0d269cf698a727b1ac860f4683eeea194c255d43f74b" + }, + "fixture" : "query/filters/text/textWithASingleWord", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery((query) -> query.filter(text(\"coffee\")));\n }", + "legacyBodySha256" : "b1b04177420b391a214a1b0cdc17d693cebaebd35466fe389505535708d5579f", + "legacyMethod" : "testTextWithASingleWord", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : true, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "4096e690343505113ac79cba32d028a8b1bef4d79e573161c6b1fd8b35852c52", + "text" : "db.articles.find( { $text: { $search: \"coffee\" } } )" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "1b2f58f67b6e2f3e810d1d89443973e036e603097e2ed1a0a6c891fa2c1e4efc", + "text" : "{ _id: 1, subject: 'coffee', author: 'xyz', views: 50 },\n{ _id: 7, subject: 'coffee and cream', author: 'efg', views: 10 },\n{ _id: 2, subject: 'Coffee Shopping', author: 'efg', views: 5 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "``$text`` with a Single Word", + "fixture" : "query/filters/text/textWithASingleWord", + "fixtureFiles" : { + "action.json" : "4096e690343505113ac79cba32d028a8b1bef4d79e573161c6b1fd8b35852c52", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "1b2f58f67b6e2f3e810d1d89443973e036e603097e2ed1a0a6c891fa2c1e4efc", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "50330365b7bc2bdaef5c0d269cf698a727b1ac860f4683eeea194c255d43f74b" + }, + "includes" : [ { + "blob" : "e360d3a4c226e0d9c595ed610e494dce21b2cb47", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "e78d7ffbce773cfbca1385235582b09d9cc9a733", + "path" : "source/includes/fact-text-search-phrase-and-term.rst" + }, { + "blob" : "2eedcd0e0a4bc58be17eafd3d0856add713d5733", + "path" : "source/includes/fact-text-search-multiple-phrases.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "4e4d5dbac144984c134f2224a091f715855df525", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "f5efa7c2b14d22ec139f3ea5a0e37bca1aefa874", + "pageBlob" : "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json", + "scenarioSha256" : "ba224a69fbd007e2e2be7cccee3e9cea001198df133b119ed7edb5dae00da5b3", + "test" : "dev.morphia.test.query.filters.TestText#testTextWithASingleWord" + }, { + "bodyEdit" : null, + "files" : { + "action.json" : "b2c9a135d54d6206b41422cfe71237eb74afecccf351ba108f9f667122b69ed2", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "29affe37b0cb096e63b63451fd47501201873d8c93861c4f26ac841586fef34e", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "2fef2a4112caaa6502845d43475b9c2d572f722468653f93b84852c09e8d4ee6" + }, + "fixture" : "query/filters/text/textWithAnExactString", + "kind" : "CONVERTED", + "legacyBody" : "{\n testQuery(new ActionTestOptions().orderMatters(false), (query) -> query.filter(text(\"\\\"coffee shop\\\"\")\n\n ));\n }", + "legacyBodySha256" : "9b1ecd940f1bf31ce7bccb3e76e8b31a330381878966828817eb340e15096c7c", + "legacyMethod" : "testTextWithAnExactString", + "legacyType" : "dev.morphia.test.query.filters.TestText", + "options" : [ ], + "ordered" : false, + "override" : { + "blocks" : [ { + "role" : "ACTION", + "sha256" : "b2c9a135d54d6206b41422cfe71237eb74afecccf351ba108f9f667122b69ed2", + "text" : "db.articles.find( { $text: { $search: \"\\\"coffee shop\\\"\" } } )" + }, { + "role" : "DATA", + "sha256" : "d939a0bdb49ef917cb388d75c95a0167985d64fa7a689b44aa187d49495b4690", + "text" : "db.articles.insertMany( [\n { _id: 1, subject: \"coffee\", author: \"xyz\", views: 50 },\n { _id: 2, subject: \"Coffee Shopping\", author: \"efg\", views: 5 },\n { _id: 3, subject: \"Baking a cake\", author: \"abc\", views: 90 },\n { _id: 4, subject: \"baking\", author: \"xyz\", views: 100 },\n { _id: 5, subject: \"Café Con Leche\", author: \"abc\", views: 200 },\n { _id: 6, subject: \"Сырники\", author: \"jkl\", views: 80 },\n { _id: 7, subject: \"coffee and cream\", author: \"efg\", views: 10 },\n { _id: 8, subject: \"Cafe con Leche\", author: \"xyz\", views: 10 }\n] )" + }, { + "role" : "EXPECTED", + "sha256" : "29affe37b0cb096e63b63451fd47501201873d8c93861c4f26ac841586fef34e", + "text" : "{ \"_id\" : 2, \"subject\" : \"Coffee Shopping\", \"author\" : \"efg\", \"views\" : 5 }" + }, { + "role" : "INDEX", + "sha256" : "17d16d38e69065181aa8c466ba2318f512838a0ab738a0290d0dd6a7cb3c4735", + "text" : "db.articles.createIndex( { subject: \"text\" } )" + } ], + "collections" : { }, + "corrections" : [ ], + "example" : "``$text`` with an Exact String", + "fixture" : "query/filters/text/textWithAnExactString", + "fixtureFiles" : { + "action.json" : "b2c9a135d54d6206b41422cfe71237eb74afecccf351ba108f9f667122b69ed2", + "data.json" : "574470b15f63be72d8791c0bf646449187875df16393dd1039bb1fab077ee4e8", + "expected.json" : "29affe37b0cb096e63b63451fd47501201873d8c93861c4f26ac841586fef34e", + "index.json" : "0d2944690866f2aa8710c6046c8d3593b32c447f1f0b2658f0394bb27fb9f362", + "name" : "2fef2a4112caaa6502845d43475b9c2d572f722468653f93b84852c09e8d4ee6" + }, + "includes" : [ { + "blob" : "e3ce5a3bd4ba114d753bdd9fe3ce91c3c8ce473d", + "path" : "source/includes/extracts-atlas-search-facts.yaml" + }, { + "blob" : "a140ad76120c4e6b1b54a9596dddb4c5d1dcb6fa", + "path" : "source/includes/fact-compatibility.rst" + }, { + "blob" : "af0e90475267dcf0a4b56e11aae76eeee3805ee4", + "path" : "source/includes/fact-environments.rst" + }, { + "blob" : "b770b45bc50f47b7b5d8cd771754c17a113b364f", + "path" : "source/includes/fact-environments-atlas-only.rst" + }, { + "blob" : "a7fa92b7a8083b9a17700e67517a1831f359c476", + "path" : "source/includes/fact-environments-onprem-only.rst" + }, { + "blob" : "99ffff8b9dbf77ce27ea92414cf76853a348752d", + "path" : "source/includes/fact-text-search-language-none.rst" + }, { + "blob" : "8c95dbe444efb517395c376736ee2216096b9dfa", + "path" : "source/includes/list-text-search-restrictions-in-agg.rst" + }, { + "blob" : "a891f76e4032268b63849ceba85f3724e57dc430", + "path" : "source/includes/fact-text-search-multiword-and-term.rst" + }, { + "blob" : "50afb761bede2976f652398ce19d3338b2e21947", + "path" : "source/includes/fact-text-search-score.rst" + }, { + "blob" : "ce0ad62c0fd4fb744814d4c4f664366c8244e240", + "path" : "source/includes/extracts-4.4-changes.yaml" + } ], + "origin" : "1eadd328c067b852f4a8bed438f78bf30c52b183", + "pageBlob" : "505c57dcb2997450154e0fe4433a193cfe35ac9d", + "retiredLock" : null, + "retypes" : [ ], + "rules" : [ ], + "shape" : "FIND", + "source" : { + "commit" : "dabbeba3f7126b90d5a32ea66ca9b59c8a105a25", + "path" : "source/reference/operator/query/text.txt", + "relation" : "AT_ORIGIN" + }, + "unexpandedIncludes" : [ ] + }, + "scenario" : "core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json", + "scenarioSha256" : "eb71dbdc9a7918a19a15f805128266ed7383946a1a18134634a8dee607563b60", + "test" : "dev.morphia.test.query.filters.TestText#testTextWithAnExactString" }, { "bodyEdit" : null, "files" : { 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 fd37e987244..6e3d8e21782 100644 --- a/audits/src/main/kotlin/dev/morphia/audits/repairs/FixtureMigration.kt +++ b/audits/src/main/kotlin/dev/morphia/audits/repairs/FixtureMigration.kt @@ -329,7 +329,16 @@ object FixtureMigration { ) .append("dataset", dataset?.let { BsonString(it) } ?: BsonNull.VALUE) .append("collections", collections) - .append("indexes", BsonArray()) + .append( + "indexes", + BsonArray( + documented.indexes.map { index -> + BsonDocument("collection", BsonString(index.collection)) + .append("keys", index.keys) + .also { spec -> index.options?.let { spec["options"] = it } } + } + ), + ) .append("action", action) .append( "expected", diff --git a/audits/src/main/kotlin/dev/morphia/audits/repairs/FormMigration.kt b/audits/src/main/kotlin/dev/morphia/audits/repairs/FormMigration.kt index 3eb2c62ae5c..e78890d131e 100644 --- a/audits/src/main/kotlin/dev/morphia/audits/repairs/FormMigration.kt +++ b/audits/src/main/kotlin/dev/morphia/audits/repairs/FormMigration.kt @@ -13,6 +13,7 @@ import dev.morphia.audits.semantics.BsonDifferenceKind import dev.morphia.audits.semantics.BsonPath import dev.morphia.audits.shell.AggregateOperation import dev.morphia.audits.shell.FindOperation +import dev.morphia.audits.shell.IndexOperation import dev.morphia.audits.shell.InsertOperation import dev.morphia.audits.shell.LegacyDocuments import dev.morphia.audits.shell.ProgramBlock @@ -175,6 +176,13 @@ enum class BlockRole { data class SourceBlock(val role: BlockRole, val text: String, val sha256: String) /** A documented operation in BSON: seed data by collection, the action, and its printed result. */ +/** An index the page creates: its collection, key document and `createIndex` options. */ +data class DocumentedIndex( + val collection: String, + val keys: BsonDocument, + val options: BsonDocument?, +) + data class DocumentedScenario( val collection: String, val data: Map>, @@ -193,6 +201,8 @@ data class DocumentedScenario( * addresses. The scenario never carries them; see [printed]. */ val documents: List? = null, + /** The indexes the page creates before the action, in order. */ + val indexes: List = emptyList(), ) data class FormOverride( @@ -998,7 +1008,6 @@ object FormMigration { val action = documented.alternatives.single() require(shape == null || action.shape == shape) { "$label: action is ${action.shape}" } val expected = blocks.filter { it.role == BlockRole.EXPECTED } - require(blocks.none { it.role == BlockRole.INDEX }) { "$label: indexes are not supported" } val printed = if (expected.isEmpty()) null else @@ -1015,6 +1024,7 @@ object FormMigration { printed, action.many, listed.takeIf { it.isNotEmpty() && it.all { rows -> rows != null } }?.flatMap { it!! }, + indexes = documented.indexes, ) } @@ -1051,6 +1061,7 @@ object FormMigration { val alternatives: List, val collection: String, val data: Map>, + val indexes: List = emptyList(), ) private fun documented(blocks: List): Any { @@ -1070,18 +1081,39 @@ object FormMigration { blocks = programs.mapIndexed { index, block -> ProgramBlock("data$index", block.text, ProgramRole.SETUP) - } + ProgramBlock("action", action.text, ProgramRole.ACTION), + } + + blocks + .filter { it.role == BlockRole.INDEX } + .mapIndexed { index, block -> + ProgramBlock("index$index", block.text, ProgramRole.SETUP) + } + + ProgramBlock("action", action.text, ProgramRole.ACTION), ) ) if (program.state != ShellLiteralState.NORMALIZED) { return gap(FormGap.SOURCE_UNSUPPORTED, program.problems.joinToString { it.code }) } - val inserts = - program.commands - .filter { it.role == ProgramRole.SETUP } + val setup = program.commands.filter { it.role == ProgramRole.SETUP } + setup + .firstOrNull { it.operation !is InsertOperation && it.operation !is IndexOperation } + ?.let { + return gap(FormGap.SOURCE_UNSUPPORTED, "setup ${it.operation.kind}") + } + val inserts = setup.filter { it.operation is InsertOperation } + val indexes = + setup + .filter { it.operation is IndexOperation } .map { - it.operation as? InsertOperation - ?: return gap(FormGap.SOURCE_UNSUPPORTED, "setup ${it.operation.kind}") + val index = it.operation as IndexOperation + DocumentedIndex( + it.namespace?.collection + ?: return gap( + FormGap.SOURCE_UNSUPPORTED, + "an index without a collection", + ), + index.keys.value().asDocument(), + index.options?.value()?.asDocument(), + ) } val commands = program.commands.filter { it.role == ProgramRole.ACTION } if (commands.isEmpty() || commands.map { it.namespace }.toSet().size != 1) { @@ -1096,11 +1128,9 @@ object FormMigration { } val collection = commands.first().namespace!!.collection val inserted = - program.commands - .filter { it.role == ProgramRole.SETUP } - .zip(inserts) - .groupBy({ it.first.namespace!!.collection }) { (_, insert) -> - insert.documents.map { it.value() } + inserts + .groupBy({ it.namespace!!.collection }) { command -> + (command.operation as InsertOperation).documents.map { it.value() } } .mapValues { (_, documents) -> documents.flatten() } // A listing names no collection; it is the action's only when nothing else is documented. @@ -1153,7 +1183,7 @@ object FormMigration { if (alternatives.map { it.shape to it.many }.toSet().size != 1) { return gap(FormGap.SOURCE_UNSUPPORTED, "action commands of different kinds") } - return Documented(alternatives, collection, data) + return Documented(alternatives, collection, data, indexes) } private fun reproduce( diff --git a/audits/src/test/kotlin/dev/morphia/audits/offline/GeneratorTest.kt b/audits/src/test/kotlin/dev/morphia/audits/offline/GeneratorTest.kt index 3aedf8f613c..6a6b3420b2b 100644 --- a/audits/src/test/kotlin/dev/morphia/audits/offline/GeneratorTest.kt +++ b/audits/src/test/kotlin/dev/morphia/audits/offline/GeneratorTest.kt @@ -201,6 +201,7 @@ class GeneratorTest { |Match Larger Quantities |~~~~~~~~~~~~~~~~~~~~~~~ | + |${block("db.inventory.createIndex( { qty: 1 }, { name: \"byQty\" } )")} |${block("db.inventory.find( { qty: { ${'$'}gt: 20 } } )")} |Project the Quantity |~~~~~~~~~~~~~~~~~~~~ @@ -257,6 +258,18 @@ class GeneratorTest { "core/src/test/java/dev/morphia/test/generated/filters/TestGt.java" ) assertTrue("(query) -> query.filter(gt(\"qty\", 20)));" in find, find) + // The page's index travels with the case; the runner creates it before the action. + val found = generation.cases.first().manifest + assertEquals( + BsonDocument.parse( + "{collection: 'inventory', keys: {qty: 1}, options: {name: 'byQty'}}" + ), + BsonDocument.parse( + generation.files.getValue("core/src/test/resources${found.scenario}") + ) + .getArray("indexes") + .single(), + ) val update = generation.files.getValue( "core/src/test/java/dev/morphia/test/generated/updates/TestInc.java" diff --git a/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java b/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java index 1ca2ff27f79..5dc9983a24a 100644 --- a/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java +++ b/core/src/test/java/dev/morphia/test/OperatorCaseRunner.java @@ -54,8 +54,8 @@ * published comparison only, a * {@code requirements.minimumServer} skips the case on an older server, and a check the scenario lists under * {@code skipped}, with its reason, is not run. This runner supports aggregations with exact or printed expected results - * and no tolerances or indexes, and a dataset only when the scenario skips its results; a scenario that needs any - * of them fails rather than being checked loosely. + * and no tolerances, and a dataset only when the scenario skips its results; a scenario that needs either fails rather + * than being checked loosely. Documented indexes are created on both databases after they are seeded. */ public class OperatorCaseRunner { // Canonical extended JSON, so a failure shows BSON types: relaxed JSON prints an Int64 like an Int32. @@ -236,6 +236,8 @@ private void run(OperatorCase operatorCase, String kind, Shape shape, BsonDocument seeded = withIds(scenario.getDocument("collections")); seed(morphia, seeded); seed(reference, seeded); + index(morphia, scenario.getArray("indexes")); + index(reference, scenario.getArray("indexes")); Execution execution = plan.apply(action, collection); BsonArray documented = documented(action); @@ -314,8 +316,11 @@ private static void supported(OperatorCase operatorCase, BsonDocument scenario) if (!scenario.get("dataset").isNull() && !scenario.getDocument("skipped", new BsonDocument()).containsKey("results")) { unsupported.add("dataset"); } - if (!scenario.getArray("indexes").isEmpty()) { - unsupported.add("indexes"); + for (BsonValue index : scenario.getArray("indexes")) { + if (!index.isDocument() || !index.asDocument().isString("collection") || !index.asDocument().isDocument("keys") + || !Set.of("collection", "keys", "options").containsAll(index.asDocument().keySet())) { + unsupported.add("index " + index); + } } for (BsonValue rule : comparison.getArray("rules")) { if (Arrays.stream(Rule.values()).noneMatch(known -> known.name().equals(rule.asString().getValue()))) { @@ -412,6 +417,30 @@ private void seed(MongoDatabase database, BsonDocument collections) { }); } + /** + * Creates the documented indexes through {@code createIndexes}, so every option the page passes reaches the server + * as written. An index without a name gets the shell's default, its keys and values joined by underscores. + */ + private static void index(MongoDatabase database, BsonArray indexes) { + for (BsonValue value : indexes) { + BsonDocument index = value.asDocument(); + BsonDocument keys = index.getDocument("keys"); + BsonDocument spec = new BsonDocument("key", keys); + BsonDocument options = index.getDocument("options", new BsonDocument()); + if (!options.containsKey("name")) { + List parts = new ArrayList<>(); + keys.forEach((field, order) -> { + parts.add(field); + parts.add(order.isString() ? order.asString().getValue() : String.valueOf(order.asNumber().intValue())); + }); + spec.put("name", new BsonString(String.join("_", parts))); + } + spec.putAll(options); + database.runCommand(new BsonDocument("createIndexes", index.getString("collection")) + .append("indexes", new BsonArray(List.of(spec)))); + } + } + /** {@code collections} with an {@code _id} given to each document that has none. */ private static BsonDocument withIds(BsonDocument collections) { BsonDocument result = new BsonDocument(); 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 6da4bbe532a..8a1e953921a 100644 --- a/core/src/test/resources/dev/morphia/test/generated/manifest.json +++ b/core/src/test/resources/dev/morphia/test/generated/manifest.json @@ -1704,6 +1704,41 @@ "name" : "query/filters/regex/extendRegexOptionsToMatchCharactersOutsideOfAscii", "scenario" : "/dev/morphia/test/query/filters/regex/extendRegexOptionsToMatchCharactersOutsideOfAscii/scenario.json", "test" : "dev.morphia.test.query.filters.TestRegex#testExtendRegexOptionsToMatchCharactersOutsideOfAscii" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/caseAndDiacriticInsensitivity", + "scenario" : "/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testCaseAndDiacriticInsensitivity" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/caseSensitivity", + "scenario" : "/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testCaseSensitivity" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/excludeDocumentsThatContainATerm", + "scenario" : "/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testExcludeDocumentsThatContainATerm" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/matchAnyOfTheSearchTerms", + "scenario" : "/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testMatchAnyOfTheSearchTerms" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/queryADifferentLanguage", + "scenario" : "/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testQueryADifferentLanguage" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/textWithASingleWord", + "scenario" : "/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testTextWithASingleWord" + }, { + "kind" : "CONVERTED", + "name" : "query/filters/text/textWithAnExactString", + "scenario" : "/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json", + "test" : "dev.morphia.test.query.filters.TestText#testTextWithAnExactString" }, { "kind" : "CONVERTED", "name" : "query/updates/addToSet/eachModifier", @@ -3321,6 +3356,34 @@ "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/query/filters/regex/extendRegexOptionsToMatchCharactersOutsideOfAscii/scenario.json", "sha256" : "4f628b36f14ba15d1ad3003a1a79889e4db218c46bb2bd861f52a91986155fb9" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json", + "sha256" : "23a6ed77264099ff60097e58840384f08ba1d4e7ea951530cc7effd614a57aa5" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json", + "sha256" : "ab0dbfb8650d82cf58f4c8c0c3be0b04fb175e1b286e166ee3d3555fc5f09509" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json", + "sha256" : "c733276cfe0aef91ad6305d9c68fea17d686c2d51d7682045517d8dbc5cb279a" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json", + "sha256" : "c57491c7d383c8f957cc749980aaecdc30cbe5c0fcdcb99c7dab6f8acf6072fd" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json", + "sha256" : "f96a5fc66dd8a48fa6ffcaa220857295d31e777347cf7c8f0d3adadffa7506e5" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json", + "sha256" : "ba224a69fbd007e2e2be7cccee3e9cea001198df133b119ed7edb5dae00da5b3" + }, { + "owner" : "GENERATED", + "path" : "src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json", + "sha256" : "eb71dbdc9a7918a19a15f805128266ed7383946a1a18134634a8dee607563b60" }, { "owner" : "GENERATED", "path" : "src/test/resources/dev/morphia/test/query/updates/addToSet/eachModifier/scenario.json", diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/action.json deleted file mode 100644 index 639213bc3f2..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/action.json +++ /dev/null @@ -1 +0,0 @@ -db.articles.find( { $text: { $search: "сы́рники CAFÉS" } } ) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/expected.json deleted file mode 100644 index 143de8595b2..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "_id" : 6, "subject" : "Сырники", "author" : "jkl", "views" : 80 } -{ "_id" : 5, "subject" : "Café Con Leche", "author" : "abc", "views" : 200 } -{ "_id" : 8, "subject" : "Cafe con Leche", "author" : "xyz", "views" : 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/name b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/name deleted file mode 100644 index 7528893a283..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/name +++ /dev/null @@ -1 +0,0 @@ -Case and Diacritic Insensitivity \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json new file mode 100644 index 00000000000..eddde7bc28a --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/caseAndDiacriticInsensitivity/scenario.json @@ -0,0 +1,226 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/caseAndDiacriticInsensitivity", + "title": "Case and Diacritic Insensitivity", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path": "source/reference/operator/query/text.txt", + "blob": "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "сы\u0301рники CAFÉS" + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "6" + } + } + }, + { + "name": "subject", + "value": { + "text": "Сырники" + } + }, + { + "name": "author", + "value": { + "text": "jkl" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "80" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "5" + } + } + }, + { + "name": "subject", + "value": { + "text": "Café Con Leche" + } + }, + { + "name": "author", + "value": { + "text": "abc" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "200" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "8" + } + } + }, + { + "name": "subject", + "value": { + "text": "Cafe con Leche" + } + }, + { + "name": "author", + "value": { + "text": "xyz" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "10" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/action.json deleted file mode 100644 index 5714033b71c..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/action.json +++ /dev/null @@ -1 +0,0 @@ -db.articles.find( { $text: { $search: "Coffee", $caseSensitive: true } } ) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/expected.json deleted file mode 100644 index 2aea5df5fcb..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : 2, "subject" : "Coffee Shopping", "author" : "efg", "views" : 5 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/name b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/name deleted file mode 100644 index 132c3145494..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/name +++ /dev/null @@ -1 +0,0 @@ -Case Sensitivity \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json new file mode 100644 index 00000000000..44ac2bbdfc6 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/caseSensitivity/scenario.json @@ -0,0 +1,163 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/caseSensitivity", + "title": "Case Sensitivity", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path": "source/reference/operator/query/text.txt", + "blob": "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "Coffee", + "$caseSensitive": true + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "subject", + "value": { + "text": "Coffee Shopping" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "5" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/action.json deleted file mode 100644 index 4a60953d284..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/action.json +++ /dev/null @@ -1 +0,0 @@ -db.articles.find( { $text: { $search: "coffee -shop" } } ) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/expected.json deleted file mode 100644 index 41d1e84a768..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/expected.json +++ /dev/null @@ -1,2 +0,0 @@ -{ "_id" : 7, "subject" : "coffee and cream", "author" : "efg", "views" : 10 } -{ "_id" : 1, "subject" : "coffee", "author" : "xyz", "views" : 50 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/name b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/name deleted file mode 100644 index c81b1af7a8c..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/name +++ /dev/null @@ -1 +0,0 @@ -Exclude Documents That Contain a Term \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json new file mode 100644 index 00000000000..3ad1815aa36 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/excludeDocumentsThatContainATerm/scenario.json @@ -0,0 +1,194 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/excludeDocumentsThatContainATerm", + "title": "Exclude Documents That Contain a Term", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path": "source/reference/operator/query/text.txt", + "blob": "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "coffee -shop" + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "7" + } + } + }, + { + "name": "subject", + "value": { + "text": "coffee and cream" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "10" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "subject", + "value": { + "text": "coffee" + } + }, + { + "name": "author", + "value": { + "text": "xyz" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "50" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/action.json deleted file mode 100644 index 964ceaa755f..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/action.json +++ /dev/null @@ -1 +0,0 @@ -db.articles.find( { $text: { $search: "bake coffee cake" } } ) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/expected.json deleted file mode 100644 index ea61d38dc8d..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/expected.json +++ /dev/null @@ -1,5 +0,0 @@ -{ "_id" : 2, "subject" : "Coffee Shopping", "author" : "efg", "views" : 5 } -{ "_id" : 7, "subject" : "coffee and cream", "author" : "efg", "views" : 10 } -{ "_id" : 1, "subject" : "coffee", "author" : "xyz", "views" : 50 } -{ "_id" : 3, "subject" : "Baking a cake", "author" : "abc", "views" : 90 } -{ "_id" : 4, "subject" : "baking", "author" : "xyz", "views" : 100 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/name b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/name deleted file mode 100644 index 909a353e976..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/name +++ /dev/null @@ -1 +0,0 @@ -Match Any of the ``$search`` Terms \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json new file mode 100644 index 00000000000..7849046c2e3 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/matchAnyOfTheSearchTerms/scenario.json @@ -0,0 +1,290 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/matchAnyOfTheSearchTerms", + "title": "Match Any of the ``$search`` Terms", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path": "source/reference/operator/query/text.txt", + "blob": "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "bake coffee cake" + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "subject", + "value": { + "text": "Coffee Shopping" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "5" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "7" + } + } + }, + { + "name": "subject", + "value": { + "text": "coffee and cream" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "10" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "subject", + "value": { + "text": "coffee" + } + }, + { + "name": "author", + "value": { + "text": "xyz" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "50" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "3" + } + } + }, + { + "name": "subject", + "value": { + "text": "Baking a cake" + } + }, + { + "name": "author", + "value": { + "text": "abc" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "90" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "4" + } + } + }, + { + "name": "subject", + "value": { + "text": "baking" + } + }, + { + "name": "author", + "value": { + "text": "xyz" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "100" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/action.json deleted file mode 100644 index c9373fd065e..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/action.json +++ /dev/null @@ -1,3 +0,0 @@ -db.articles.find( - { $text: { $search: "leche", $language: "es" } } -) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/expected.json deleted file mode 100644 index 8c05c76ac91..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/expected.json +++ /dev/null @@ -1,2 +0,0 @@ -{ "_id" : 5, "subject" : "Café Con Leche", "author" : "abc", "views" : 200 } -{ "_id" : 8, "subject" : "Cafe con Leche", "author" : "xyz", "views" : 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/name b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/name deleted file mode 100644 index d67c8a66835..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/name +++ /dev/null @@ -1 +0,0 @@ -Query a Different Language \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json new file mode 100644 index 00000000000..5e48e97a24f --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/queryADifferentLanguage/scenario.json @@ -0,0 +1,195 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/queryADifferentLanguage", + "title": "Query a Different Language", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path": "source/reference/operator/query/text.txt", + "blob": "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "leche", + "$language": "es" + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "5" + } + } + }, + { + "name": "subject", + "value": { + "text": "Café Con Leche" + } + }, + { + "name": "author", + "value": { + "text": "abc" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "200" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "8" + } + } + }, + { + "name": "subject", + "value": { + "text": "Cafe con Leche" + } + }, + { + "name": "author", + "value": { + "text": "xyz" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "10" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/action.json deleted file mode 100644 index 9f614d371b7..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/action.json +++ /dev/null @@ -1 +0,0 @@ -db.articles.find( { $text: { $search: "coffee" } } ) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/expected.json deleted file mode 100644 index a8b4f001bed..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ _id: 1, subject: 'coffee', author: 'xyz', views: 50 }, -{ _id: 7, subject: 'coffee and cream', author: 'efg', views: 10 }, -{ _id: 2, subject: 'Coffee Shopping', author: 'efg', views: 5 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/name b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/name deleted file mode 100644 index 9bcf58ca547..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/name +++ /dev/null @@ -1 +0,0 @@ -``$text`` with a Single Word \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json new file mode 100644 index 00000000000..4f807139db5 --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithASingleWord/scenario.json @@ -0,0 +1,226 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/textWithASingleWord", + "title": "``$text`` with a Single Word", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "d7f95ad70b1073047e6b3b46f5950a5e54af8a9f", + "path": "source/reference/operator/query/text.txt", + "blob": "fe7d97c80ffc0dde4edc0b15bfa1b30c8715409a" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "coffee" + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "1" + } + } + }, + { + "name": "subject", + "value": { + "text": "coffee" + } + }, + { + "name": "author", + "value": { + "text": "xyz" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "50" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "7" + } + } + }, + { + "name": "subject", + "value": { + "text": "coffee and cream" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "10" + } + } + } + ] + }, + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "subject", + "value": { + "text": "Coffee Shopping" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "5" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "ORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/action.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/action.json deleted file mode 100644 index 8ebaefffe40..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/action.json +++ /dev/null @@ -1 +0,0 @@ -db.articles.find( { $text: { $search: "\"coffee shop\"" } } ) \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/data.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/data.json deleted file mode 100644 index 460579147df..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/data.json +++ /dev/null @@ -1,8 +0,0 @@ -{ _id: 1, subject: "coffee", author: "xyz", views: 50 }, -{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }, -{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }, -{ _id: 4, subject: "baking", author: "xyz", views: 100 }, -{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 }, -{ _id: 6, subject: "Сырники", author: "jkl", views: 80 }, -{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }, -{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/expected.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/expected.json deleted file mode 100644 index 2aea5df5fcb..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/expected.json +++ /dev/null @@ -1 +0,0 @@ -{ "_id" : 2, "subject" : "Coffee Shopping", "author" : "efg", "views" : 5 } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/index.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/index.json deleted file mode 100644 index dc1043aa156..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/index.json +++ /dev/null @@ -1 +0,0 @@ -{ subject: "text" } \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/name b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/name deleted file mode 100644 index 27dc7657d22..00000000000 --- a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/name +++ /dev/null @@ -1 +0,0 @@ -``$text`` with an Exact String \ No newline at end of file diff --git a/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json new file mode 100644 index 00000000000..cc36ea84dad --- /dev/null +++ b/core/src/test/resources/dev/morphia/test/query/filters/text/textWithAnExactString/scenario.json @@ -0,0 +1,162 @@ +{ + "schemaVersion": { + "$numberInt": "1" + }, + "name": "query/filters/text/textWithAnExactString", + "title": "``$text`` with an Exact String", + "context": "FILTER", + "source": { + "repository": "mongodb/docs", + "commit": "dabbeba3f7126b90d5a32ea66ca9b59c8a105a25", + "path": "source/reference/operator/query/text.txt", + "blob": "505c57dcb2997450154e0fe4433a193cfe35ac9d" + }, + "dataset": null, + "collections": { + "articles": [ + { + "_id": { + "$numberInt": "1" + }, + "subject": "coffee", + "author": "xyz", + "views": { + "$numberInt": "50" + } + }, + { + "_id": { + "$numberInt": "2" + }, + "subject": "Coffee Shopping", + "author": "efg", + "views": { + "$numberInt": "5" + } + }, + { + "_id": { + "$numberInt": "3" + }, + "subject": "Baking a cake", + "author": "abc", + "views": { + "$numberInt": "90" + } + }, + { + "_id": { + "$numberInt": "4" + }, + "subject": "baking", + "author": "xyz", + "views": { + "$numberInt": "100" + } + }, + { + "_id": { + "$numberInt": "5" + }, + "subject": "Café Con Leche", + "author": "abc", + "views": { + "$numberInt": "200" + } + }, + { + "_id": { + "$numberInt": "6" + }, + "subject": "Сырники", + "author": "jkl", + "views": { + "$numberInt": "80" + } + }, + { + "_id": { + "$numberInt": "7" + }, + "subject": "coffee and cream", + "author": "efg", + "views": { + "$numberInt": "10" + } + }, + { + "_id": { + "$numberInt": "8" + }, + "subject": "Cafe con Leche", + "author": "xyz", + "views": { + "$numberInt": "10" + } + } + ] + }, + "indexes": [ + { + "collection": "articles", + "keys": { + "subject": "text" + } + } + ], + "action": { + "kind": "find", + "collection": "articles", + "filter": { + "$text": { + "$search": "\"coffee shop\"" + } + } + }, + "expected": { + "printed": [ + { + "document": [ + { + "name": "_id", + "value": { + "whole": { + "$numberInt": "2" + } + } + }, + { + "name": "subject", + "value": { + "text": "Coffee Shopping" + } + }, + { + "name": "author", + "value": { + "text": "efg" + } + }, + { + "name": "views", + "value": { + "whole": { + "$numberInt": "5" + } + } + } + ] + } + ] + }, + "comparison": { + "order": "UNORDERED", + "rules": [], + "ignore": [], + "tolerance": null + }, + "requirements": { + "minimumServer": null, + "topology": "STANDALONE" + } +} diff --git a/design/operator-audits-design.md b/design/operator-audits-design.md index e63d4ef2fe6..4c71d694b94 100644 --- a/design/operator-audits-design.md +++ b/design/operator-audits-design.md @@ -109,7 +109,7 @@ A case is one documented example, described entirely by a `scenario.json` (schem | --- | --- | | `name`, `title`, `context` | The qualified name (`aggregation/expressions/add/addNonIntegerValuesToADate`), the page's title for it, and the operator context. | | `source` | The repository, commit, path and blob of the page it came from. | -| `collections`, `indexes`, `dataset` | The seed data, in extended JSON with exact BSON types. | +| `collections`, `indexes`, `dataset` | The seed data, in extended JSON with exact BSON types; the indexes the page creates, each with its collection, keys and options; or the sample dataset the example queries instead. | | `action` | The documented command: an aggregate pipeline, a find, or an update, with its collection. | | `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. | @@ -122,7 +122,8 @@ fixtures by method name, ordinal or stack trace. ### The runner `OperatorCaseRunner` takes a scenario and a function that builds the operation with Morphia's -API: `aggregate`, `find` or `update`. It checks three things separately, against a real server: +API: `aggregate`, `find` or `update`. It seeds two identical databases with the documented data and +indexes, then checks three things separately, against a real server: 1. **Serialization.** The BSON Morphia emits equals the documented action, strictly, after the scenario's declared form rules are applied to both sides. diff --git a/design/operator-audits-progress.md b/design/operator-audits-progress.md index 72840546985..7e794acb2c9 100644 --- a/design/operator-audits-progress.md +++ b/design/operator-audits-progress.md @@ -18,7 +18,7 @@ how the audits work updates it too; this file records what each PR delivered. Every step of the plan (0–7) has been started. What stands: -- **On the runner:** 363 legacy cases (362 converted, 1 migrated), plus 14 generated cases. +- **On the runner:** 370 legacy cases (369 converted, 1 migrated), plus 14 generated cases. Core gate: 662 tests under each mapper; audits: 452. - **Generation:** inventory of mongodb/docs `e4b0c153` (297 pages read, tested snippets included; 437 examples owned, 145 unowned, none unnamed or ambiguous after review), reviewed DSL bindings checked against core's API, and the @@ -44,13 +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:** 193 directories. +- **The remaining legacy fixtures:** 186 directories. - 98 are locked; 96 are unresolved in `form-review.json`. - - 23 are legacy-only in `cutover.json`. + - 16 are legacy-only in `cutover.json`. - 69 never-locked fixtures have no pinned reference. - **Deferred cutover features:** documented projections (`findOptions`), update options (`arrayFilters`, `upsert`), update results as the page reads them (the whole collection, not - the filter's matches), indexes, alternative commands. + the filter's matches), alternative commands. - **The stage pages' family** (41 unowned examples, most on sample datasets). Step 6, monitoring: @@ -2657,3 +2657,13 @@ no product-documentation changes. Legacy operator AsciiDoc tables are intentiona update, while the runner's update results are the filter's matches. Most query and update gaps are documented projections (5) and `arrayFilters` update options (5). - Core: 692 tests under each mapper; audits: 458. + +## Documented indexes (2026-11-23) + +- Branch audits-indexes. `FormMigration.documented` lowers a page's `createIndex` blocks as setup + (`ShellPrograms` already parsed them as `IndexOperation`); the scenario's `indexes` lists each + with its collection, keys and options. The runner creates them on both databases after seeding, + through `createIndexes`, naming an unnamed index as the shell does. +- The seven `$text` cases that were legacy-only because "the page creates an index" convert and + pass under both mappers. Legacy-only: 16; 186 legacy directories; 370 cases on the runner. +- Core: 692 tests under each mapper; audits: 458.