From 7a5c3f2a60b9c8420c0dccc27c85132e9a311157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Wed, 10 Jul 2024 15:32:46 +0200 Subject: [PATCH 1/5] ci(github): Run the tests in CI --- .github/workflows/CI.yaml | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/CI.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 0000000..f970ceb --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,47 @@ +name: CI + +# Run this workflow every time a new commit pushed to your repository +on: push + +jobs: + build-and-test: + name: Build and test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Build + run: ./gradlew build + + - name: Upload Unit Test Results + if: always() + uses: actions/upload-artifact@v2 + with: + name: tests-results # Name artifact for storage in cache + path: | + **/build/test-results/**/*.xml + + publish-test-results: + name: Publish tests results + runs-on: ubuntu-latest + needs: build-and-test + # the build-and-test job might be skipped, we don't need to run this job then + if: success() || failure() + permissions: + checks: write + pull-requests: write + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: tests-results # Name of artifact in cache + path: tests-results/ + + - name: Publish Unit Test Results + uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1 + if: always() + with: + github_token: ${{ github.token }} + files: tests-results/**/*.xml From 284facbcbb225970d4309441dcd87e8c02d557a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Wed, 10 Jul 2024 16:05:21 +0200 Subject: [PATCH 2/5] build: Generate a documentation website --- .../Documentation_website.xml | 31 +++++++ .../Open_documentation_website.xml | 7 ++ docs/website/.gitignore | 1 + docs/website/docs/index.md | 7 ++ docs/website/mkdocs.yml | 88 +++++++++++++++++++ docs/website/overrides/home.html | 66 ++++++++++++++ 6 files changed, 200 insertions(+) create mode 100644 .idea/runConfigurations/Documentation_website.xml create mode 100644 .idea/runConfigurations/Open_documentation_website.xml create mode 100644 docs/website/.gitignore create mode 100644 docs/website/docs/index.md create mode 100644 docs/website/mkdocs.yml create mode 100644 docs/website/overrides/home.html diff --git a/.idea/runConfigurations/Documentation_website.xml b/.idea/runConfigurations/Documentation_website.xml new file mode 100644 index 0000000..6f668cf --- /dev/null +++ b/.idea/runConfigurations/Documentation_website.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/.idea/runConfigurations/Open_documentation_website.xml b/.idea/runConfigurations/Open_documentation_website.xml new file mode 100644 index 0000000..e3ad82e --- /dev/null +++ b/.idea/runConfigurations/Open_documentation_website.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/docs/website/.gitignore b/docs/website/.gitignore new file mode 100644 index 0000000..16d3c4d --- /dev/null +++ b/docs/website/.gitignore @@ -0,0 +1 @@ +.cache diff --git a/docs/website/docs/index.md b/docs/website/docs/index.md new file mode 100644 index 0000000..f741e32 --- /dev/null +++ b/docs/website/docs/index.md @@ -0,0 +1,7 @@ +--- +template: home.html +--- + +# Welcome! + +KtMongo is the future of MongoDB. diff --git a/docs/website/mkdocs.yml b/docs/website/mkdocs.yml new file mode 100644 index 0000000..fa4a524 --- /dev/null +++ b/docs/website/mkdocs.yml @@ -0,0 +1,88 @@ +site_name: KtMongo +site_author: 4SH & contributors +site_description: > + Towards the future of MongoDB in Kotlin. +repo_url: https://github.com/4sh/ktmongo +repo_name: 4SH / KtMongo + +theme: + name: material + custom_dir: overrides + features: + - announce.dismiss + - content.action.edit + - content.action.view + - content.code.annotate + - content.code.copy + - content.code.select + # - content.footnote.tooltips + - content.tabs.link + - content.tooltips + # - header.autohide + # - navigation.expand + - navigation.footer + - navigation.indexes + # - navigation.instant + # - navigation.instant.prefetch + # - navigation.instant.progress + # - navigation.prune + - navigation.sections + - navigation.tabs + # - navigation.tabs.sticky + - navigation.top + - navigation.tracking + - search.highlight + - search.share + - search.suggest + - toc.follow + # - toc.integrate + icon: + edit: material/pencil + view: material/eye + palette: + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: "System theme (click to switch to light)" + - media: "(prefers-color-scheme: light)" + scheme: default + primary: green + accent: cyan + toggle: + icon: material/brightness-7 + name: "Light theme (click to switch to dark)" + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: green + accent: cyan + toggle: + icon: material/brightness-4 + name: "Dark theme (click to switch to system)" + +plugins: + - social + +markdown_extensions: + - admonition + - attr_list + - md_in_html + - pymdownx.details + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.tabbed: + alternate_style: true + +edit_uri: edit/main/docs/website/docs + +use_directory_urls: false + +nav: + - Home: index.md + + - Getting started: [ ] + + - Migrating from KMongo: [ ] diff --git a/docs/website/overrides/home.html b/docs/website/overrides/home.html new file mode 100644 index 0000000..b161425 --- /dev/null +++ b/docs/website/overrides/home.html @@ -0,0 +1,66 @@ +{% extends "main.html" %} +{% block tabs %} +{{ super() }} + + +
+
+
+
+

{{ config.site_name }}

+ +

{{ config.site_description }}

+ +
+
+ + + What is it? + + + + Visit reference + + + + Visit repository + +
+
+
+
+{% endblock %} + +{% block content %} +
+ {{ super() }} +
+{% endblock %} From 9bb039f62f3cdfe6ab6e58e4cb0e1239ab31ce44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Wed, 10 Jul 2024 16:28:58 +0200 Subject: [PATCH 3/5] build: Create the 'library' convention plugin --- build.gradle.kts | 6 ++++++ driver-coroutines/build.gradle.kts | 4 +--- driver-sync/build.gradle.kts | 4 +--- dsl/build.gradle.kts | 4 +--- gradle/conventions/build.gradle.kts | 8 ++++++-- gradle/conventions/src/main/kotlin/library.gradle.kts | 7 +++++++ gradle/libs.versions.toml | 5 ++++- 7 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 gradle/conventions/src/main/kotlin/library.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 7f009f5..7c35530 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,3 +3,9 @@ plugins { alias(libs.plugins.kotlin) apply false alias(libs.plugins.dokkatoo) } + +dependencies { + dokkatoo(projects.dsl) + dokkatoo(projects.driverSync) + dokkatoo(projects.driverCoroutines) +} diff --git a/driver-coroutines/build.gradle.kts b/driver-coroutines/build.gradle.kts index deedb11..dda9a80 100644 --- a/driver-coroutines/build.gradle.kts +++ b/driver-coroutines/build.gradle.kts @@ -1,8 +1,6 @@ plugins { id("conventions.base") - - alias(libs.plugins.kotlin) - alias(libs.plugins.dokkatoo) + id("conventions.library") } dependencies { diff --git a/driver-sync/build.gradle.kts b/driver-sync/build.gradle.kts index 323ff7c..d4f8ebf 100644 --- a/driver-sync/build.gradle.kts +++ b/driver-sync/build.gradle.kts @@ -1,8 +1,6 @@ plugins { id("conventions.base") - - alias(libs.plugins.kotlin) - alias(libs.plugins.dokkatoo) + id("conventions.library") } dependencies { diff --git a/dsl/build.gradle.kts b/dsl/build.gradle.kts index a56edcf..3f982fe 100644 --- a/dsl/build.gradle.kts +++ b/dsl/build.gradle.kts @@ -1,8 +1,6 @@ plugins { id("conventions.base") - - alias(libs.plugins.kotlin) - alias(libs.plugins.dokkatoo) + id("conventions.library") } dependencies { diff --git a/gradle/conventions/build.gradle.kts b/gradle/conventions/build.gradle.kts index e764714..116db11 100644 --- a/gradle/conventions/build.gradle.kts +++ b/gradle/conventions/build.gradle.kts @@ -1,8 +1,12 @@ - plugins { `kotlin-dsl` } kotlin { - jvmToolchain(8) + jvmToolchain(11) +} + +dependencies { + implementation(libs.gradle.kotlin) + implementation(libs.gradle.dokkatoo) } diff --git a/gradle/conventions/src/main/kotlin/library.gradle.kts b/gradle/conventions/src/main/kotlin/library.gradle.kts new file mode 100644 index 0000000..6d9e069 --- /dev/null +++ b/gradle/conventions/src/main/kotlin/library.gradle.kts @@ -0,0 +1,7 @@ +package conventions + +plugins { + kotlin("jvm") + id("dev.adamko.dokkatoo-html") + id("dev.adamko.dokkatoo-gfm") +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ba42a42..605cb0f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ kotest = "5.9.1" [plugins] kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -dokkatoo = { id = "dev.adamko.dokkatoo-html", version.ref = "dokkatoo" } +dokkatoo = { id = "dev.adamko.dokkatoo", version.ref = "dokkatoo" } [libraries] kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } @@ -21,6 +21,9 @@ kotest-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kote kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" } +gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +gradle-dokkatoo = { module = "dev.adamko.dokkatoo:dokkatoo-plugin", version.ref = "dokkatoo" } + [bundles] kotest = [ "kotest-junit5", From 9f277f95c6fa419f09195eb1ac7ec181c97de055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Fri, 12 Jul 2024 23:06:24 +0200 Subject: [PATCH 4/5] docs(website): Migrate the guides to the website --- docs/README.md | 20 +-- docs/website/docs/guides/overview.md | 67 ++++++++++ docs/{ => website/docs}/guides/search.md | 12 +- .../docs/guides/setup.md} | 14 +- docs/website/docs/index.md | 40 +++++- .../migrate-from-kmongo/nested-fields.md | 16 ++- .../docs/migrate-from-kmongo/search.md} | 36 +++--- .../website/docs/migrate-from-kmongo/setup.md | 9 ++ docs/website/docs/migrate-from-kmongo/why.md | 122 ++++++++++++++++++ docs/website/mkdocs.yml | 17 ++- docs/website/overrides/home.html | 18 +-- 11 files changed, 302 insertions(+), 69 deletions(-) create mode 100644 docs/website/docs/guides/overview.md rename docs/{ => website/docs}/guides/search.md (79%) rename docs/{guides/connect.md => website/docs/guides/setup.md} (71%) rename docs/{ => website/docs}/migrate-from-kmongo/nested-fields.md (70%) rename docs/{migrate-from-kmongo/dsl.md => website/docs/migrate-from-kmongo/search.md} (75%) create mode 100644 docs/website/docs/migrate-from-kmongo/setup.md create mode 100644 docs/website/docs/migrate-from-kmongo/why.md diff --git a/docs/README.md b/docs/README.md index a747e4c..979b430 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,25 +2,13 @@ To learn what KtMongo is and why it exists, see the [root README](../README.md). -To learn about specific KtMongo features, functions or operators, see the Reference. +## The website -## Getting started +The KtMongo website contains guides to get started with KtMongo, guides to migrate from KMongo to KtMongo, and the generated API reference. -To learn how to use KtMongo in your project and to learn about new MongoDB features. +Its sources are available in the [website/](website) directory. -- Adding KtMongo to your project -- [Connecting and configuring a database](guides/connect.md) -- Saving data -- [Searching for data](guides/search.md) -- Referencing nested fields - -## How to migrate from KMongo? - -List of differences between KMongo and KtMongo to help you migrate your existing projects. - -- Using KMongo and KtMongo together -- [Referencing nested fields](migrate-from-kmongo/nested-fields.md) -- [The operator DSL](migrate-from-kmongo/dsl.md) +To build it locally, run the `Open documentation website` run configuration. ## Design documents diff --git a/docs/website/docs/guides/overview.md b/docs/website/docs/guides/overview.md new file mode 100644 index 0000000..2845222 --- /dev/null +++ b/docs/website/docs/guides/overview.md @@ -0,0 +1,67 @@ +# Features overview + +This page describes the improvements brought by KtMongo over the official drivers. +If you're interested in a comparison with KMongo, see [the dedicated page](../migrate-from-kmongo/why.md). + +## Query DSL and optional filters + +A typical scenario is to filter data based on criteria passed by the user. In this example, we'll be searching for users of a given last name, with an optional minimum age filter. + +First, let's declare our classes to represent the data we're working with. The drivers will automatically deserialize documents to these classes. + +```kotlin +class User( + val _id: String, + val name: UserName, + val age: Int, +) + +class UserName( + val firstName: String, + val lastName: String, +) +``` + +Let's implement this request with the official drivers. + +```java title="With the official Java driver" +Bson filter = eq("name.lastName", lastName); + +if(minAge !=null) +filter = + +and(filter, gt("age", minAge)); + + users. + +find(filter); +``` + +The official drivers use the builder pattern. In this example, reference mutability is used to incrementally create the filter. + +This example is hard to maintain: + +- Field names, and their hierarchy, are passed as strings: when refactoring code, requests risk being outdated. +- Filters are of the type `Bson`: the type doesn't help us verify that the request actually applies to the contents of the collection. If we accidentally use a function made for another collection, its filters may apply in different ways or not apply at all if the field names are different. +- There are no type checks: we could try to compare the `name` field with a `String`, which would give no results since it is a child document. +- The structure of the request is not immediately visible at a glance, due to being spread over the condition. + +Now, let's rewrite this example with KtMongo: + +```kotlin title="With KtMongo" +users.find { + User::name / UserName::lastName eq lastName + User::age gtNotNull minAge +} +``` + +A few improvements have been made to simplify the request: + +- Referring to fields is done by writing a reference to the actual fields, meaning we can find all requests using a field by clicking on it in our IDE. +- Refactoring fields will correctly update all requests using them. +- Operator arguments are type-checked, so we cannot compare a field with an incompatible type. +- The structure of the request is immediately visible, and the `$and` operator is implied by the presence of multiple arguments. +- The `gtNotNull` operator handles the optional filter for us. +- Only filters that apply to the collection being searched in can be specified in the `find` block, we cannot accidentally use filters meant for another collection. + +These various improvements make the final request much easier to read and understand at a glance. diff --git a/docs/guides/search.md b/docs/website/docs/guides/search.md similarity index 79% rename from docs/guides/search.md rename to docs/website/docs/guides/search.md index 766afcf..65e56a8 100644 --- a/docs/guides/search.md +++ b/docs/website/docs/guides/search.md @@ -1,11 +1,10 @@ -# Searching the database +# Find data -In this document, we will see how to search for specific data in the database. - -> Pre-requisites: -> - [Obtain a collection](connect.md) +!!! note "" +Before retrieving data, you must [connect to the database and obtain a collection](setup.md). Let's assume we have the following class: + ```kotlin class User( val name: String, @@ -14,6 +13,7 @@ class User( ``` To return all documents in a collection, we can use `find`: + ```kotlin collection.find() .toList() @@ -21,6 +21,7 @@ collection.find() ``` To only return specific documents, we can add a filter expression: + ```kotlin // Find all users who have a name and who are older than 18 collection.find { @@ -31,6 +32,7 @@ collection.find { ``` If we know that only one user may exist, we can use `findOne` instead: + ```kotlin collection.findOne { User::name eq "Sylvain De La Fontaine" } ``` diff --git a/docs/guides/connect.md b/docs/website/docs/guides/setup.md similarity index 71% rename from docs/guides/connect.md rename to docs/website/docs/guides/setup.md index 1cec63b..e4f1c49 100644 --- a/docs/guides/connect.md +++ b/docs/website/docs/guides/setup.md @@ -1,10 +1,17 @@ -# Interacting with a database +# Quick start -This article describes how to connect to a MongoDB instance, how to access a specific collection, and how to perform a simple request. +## Choose between suspension and blocking + +## Add the dependency + +[//]: # (TODO: publish to central) + +KtMongo is currently not published to MavenCentral. To import it into your projects, use a [Gradle composite build](https://docs.gradle.org/current/userguide/composite_builds.html). ## Connect to a database First, instantiate a client and request a specific database: + ```kotlin val database = MongoClient.create("mongodb://localhost:PORT-NUMBER") .getDatabase("foo") @@ -15,6 +22,7 @@ To configure more options, see [the official documentation](https://www.mongodb. ## Access a collection First, create a class that represents the documents stored in the collection: + ```kotlin class User( val name: String, @@ -23,6 +31,7 @@ class User( ``` Now, instantiate the collection: + ```kotlin val collection = database.getCollection("users") .asKtMongo() @@ -31,6 +40,7 @@ val collection = database.getCollection("users") ## Perform a simple operation Now that we have access to the collection, we can perform operations on it: + ```kotlin val count = collection.countDocumentsEstimated() ``` diff --git a/docs/website/docs/index.md b/docs/website/docs/index.md index f741e32..a54f45b 100644 --- a/docs/website/docs/index.md +++ b/docs/website/docs/index.md @@ -2,6 +2,42 @@ template: home.html --- -# Welcome! +# Towards the future of MongoDB in Kotlin -KtMongo is the future of MongoDB. +In 2016, Julien Buret created [KMongo](https://github.com/Litote/kmongo), a Kotlin driver for MongoDB based on the official Java driver. KMongo added a lot of syntax sugar, making complex queries much more readable and less error-prone thanks to improved type safety: + +```java +// Official Java driver +Bson filter = and(eq("user.gender", "female"), gt("user.age", 29)); +collection. + +find(filter); +``` + +```kotlin +// KMongo +collection.find( + and( + Document::user / User::gender eq "female", + Document::user / User::age gt 29 + ) +) +``` + +In 2023, MongoDB released an official Kotlin driver. Development of KMongo stopped, but the official driver lacked much of the syntax niceties of KMongo, as well as requiring major migration efforts. As a result, many projects decided to keep using KMongo for the foreseeable future. + +We decided to take it upon ourselves to birth the future of MongoDB drivers for Kotlin. KtMongo is based on the official Kotlin driver to ensure we profit from security fixes and new features, and reimplements a DSL inspired by KMongo. + +This project is for **everyone who works with KMongo and is worried about the future after the deprecation notice**, as well as for **everyone dissatisfied with the official Kotlin driver**. + +If you're starting a new project, or are using the official Java or Kotlin drivers, [discover what we can do for you](guides/overview.md). + +## Why not just fork KMongo? + +Since KMongo was started, MongoDB and Kotlin have changed a lot. Aggregation pipelines have become an important tool, type-safety has become more critical. We believe some breaking changes are necessary to bring KMongo into the next decades. + +We intend KtMongo to be the spiritual successor to KMongo, making changes where insight has given us new ideas. We intend to facilitate gradual migration from KMongo to KtMongo such that projects can profit from these new features and official MongoDB support at their own pace. + +To achieve these objectives, KMongo and KtMongo are mutually compatible: they can both be used in a single project. However, KMongo is based on the Java driver, and KtMongo is based on the Kotlin driver, so many classes are slightly different. We recommend adding both libraries together during the migration phase, and migrating files one at a time at your own rhythm, much like when migrating from Java to Kotlin. + +To learn more about the changes we have made, see [the KMongo migration guide](migrate-from-kmongo/why.md). diff --git a/docs/migrate-from-kmongo/nested-fields.md b/docs/website/docs/migrate-from-kmongo/nested-fields.md similarity index 70% rename from docs/migrate-from-kmongo/nested-fields.md rename to docs/website/docs/migrate-from-kmongo/nested-fields.md index 685b520..52ec4b1 100644 --- a/docs/migrate-from-kmongo/nested-fields.md +++ b/docs/website/docs/migrate-from-kmongo/nested-fields.md @@ -1,6 +1,7 @@ -# Migrating from KMongo: referring to nested fields +# Referring to nested documents For the rest of this article, let's take the following example, in which the collection we're interested in is `User`: + ```kotlin class User( val name: String, @@ -19,21 +20,24 @@ class Pet( ) ``` -Referring to a non-nested field is identical with both libraries: +Referring to a non-nested field is identical with KMongo and KtMongo: + ```kotlin User::name eq "foo" ``` -Referring to nested fields is identical with both libraries: +Referring to nested documents is identical with both libraries: + ```kotlin User::country / Country::code eq "FR" ``` Referring to a list item by index uses the `get` operator: -```kotlin -// KMongo + +```kotlin title="Using KMongo" User::pets.pos(4) / Pet::name eq "Chocolat" +``` -// KtMongo +```kotlin title="Using KtMongo" User::pets[4] / Pet::name eq "Chocolat" ``` diff --git a/docs/migrate-from-kmongo/dsl.md b/docs/website/docs/migrate-from-kmongo/search.md similarity index 75% rename from docs/migrate-from-kmongo/dsl.md rename to docs/website/docs/migrate-from-kmongo/search.md index 691ea7a..a4cd0bb 100644 --- a/docs/migrate-from-kmongo/dsl.md +++ b/docs/website/docs/migrate-from-kmongo/search.md @@ -1,12 +1,12 @@ -# Migrating from KMongo: the operator DSL +# Find data KMongo operators primarily work by accepting varargs which are combined into `Bson` documents. KtMongo operators primarily work by exposing a DSL in which operators can be bound. For example, -```kotlin -// KMongo + +```kotlin title="Using KMongo" collection.findOne( and( User::name.exists(), @@ -14,9 +14,10 @@ collection.findOne( ) ) ``` + becomes: -```kotlin -// KtMongo + +```kotlin title="Using KtMongo" collection.findOne { and { User::name.exists() @@ -26,12 +27,14 @@ collection.findOne { ``` Note how: -- the parenthesis become brackets, + +- the parentheses become braces, - the trailing commas are gone. ## Default composition operators Each operation has a default operator when multiple values are passed. For example, `findOne` has a default of `$and`, meaning that these two snippets are identical: + ```kotlin collection.findOne { and { @@ -39,7 +42,9 @@ collection.findOne { User::age gt 18 } } +``` +```kotlin collection.findOne { User::name.exists() User::age gt 18 @@ -48,12 +53,11 @@ collection.findOne { ## Complex requests -One advantage of the DSL syntax is it allows using conditionals directly into the request itself, making complex requests much easier to write. +One advantage of the DSL syntax is using conditionals and loops directly into the request itself, making complex requests much easier to write. -Here's an example with KMongo: +Here's an example of a complex request with KMongo: -```kotlin -// KMongo +```kotlin title="Using KMongo" val bson = ArrayList() if (criteria.name != null) @@ -68,20 +72,20 @@ collection.findOne(and(bson)) When these kinds of requests grow, they become harder to understand because the criteria are defined further from the operation call. With KtMongo, everything is co-located and the intermediate list is eliminated: -```kotlin -// KtMongo + +```kotlin title="Using KtMongo" collection.findOne { if (criteria.name != null) User::name eq criteria.name - + if (criteria.age != null) User::age eq criteria.age } ``` -Since this specific use-case (optional filtering criteria) is so common, KtMongo offers specific operators: -```kotlin -// KtMongo +Since the specific use-case of optional filter criteria is so common, KtMongo offers specific operators that only apply to the request when their argument is non-`null`: + +```kotlin title="Using KtMongo" collection.findOne { User::name eqNotNull criteria.name User::age eqNotNull criteria.age diff --git a/docs/website/docs/migrate-from-kmongo/setup.md b/docs/website/docs/migrate-from-kmongo/setup.md new file mode 100644 index 0000000..9512895 --- /dev/null +++ b/docs/website/docs/migrate-from-kmongo/setup.md @@ -0,0 +1,9 @@ +# Quick start + +## Choose between suspension and blocking + +## Add the dependency + +[//]: # (TODO: publish to central) + +KtMongo is currently not published to MavenCentral. To import it into your projects, use a [Gradle composite build](https://docs.gradle.org/current/userguide/composite_builds.html). diff --git a/docs/website/docs/migrate-from-kmongo/why.md b/docs/website/docs/migrate-from-kmongo/why.md new file mode 100644 index 0000000..25d7d47 --- /dev/null +++ b/docs/website/docs/migrate-from-kmongo/why.md @@ -0,0 +1,122 @@ +# Why migrate from KMongo? + +If you've heard of this project, and are currently using [KMongo](https://litote.org/kmongo/), but aren't quite sure why you should migrate to KtMongo, this page is made for you. + +If you're not using KMongo, but you are using one of the official MongoDB drivers, you may prefer reading [the features overview](../guides/overview.md) instead. + +## KMongo is deprecated + +The first reason, and the instigator for the creation of KtMongo in the first place, is that [KMongo is deprecated](https://litote.org/kmongo/). After the release of the official Kotlin driver in 2023, development of the KMongo project stopped. However, the Kotlin driver doesn't have the type-safe DSL we have grown accustomed to. Because of this, many projects cannot migrate to the official driver: it would require rewriting all queries, for an end result that is less safe and harder to read. + +KtMongo aims to help migrate to the official Kotlin driver: because it reimplements a DSL inspired by KMongo, it is the best of both worlds—your project can continue using a familiar DSL, while internally using the official Kotlin driver. + +## Migration is easy + +KtMongo's DSL does have a few breaking changes as compared to KMongo's, so migration isn't just changing the imports. We make these breaking changes when we believe they improve the safety, performance or readability of the queries. + +The most visible change is the move from `vararg`-based operators to a lambda-based DSL: + +```kotlin title="Using KMongo" +songs.find( + and( + Song::artist / Artist::name eq "Zutomayo", + Song::title eq "Truth in lies", + ) +) +``` + +```kotlin title="Using KtMongo" +songs.find { + and { + Song::artist / Artist::name eq "Zutomayo" + Song::title eq "Truth in lies" + } +} +``` + +As you can see, the main difference is the replacement of parentheses by braces, and the disappearance of the comma at line endings. Other than that, most operators are unchanged, so you'll feel right at home. + +Although you could keep the request as-is, KtMongo actually allows us to simplify this example further, which we'll see [later on this article](#query-dsl-and-optional-filters). + +!!! tip "This migration could be automatic!" +The growth in popularity of OpenRewrite has made it a possible solution to automate these small refactors. We're searching for someone to help us set this up—if you'd like to help, [please contact us](https://github.com/4sh/ktmongo/discussions/21). + +## Migrate at your own pace + +KtMongo and KMongo are compatible, meaning that both can be used in the same project. + +Most projects are structured with one repository class per collection. We recommend migrating one such repository to KtMongo at a time, little by little over the course of multiple releases. This ensures the migration can be done at your own pace, without slowing down the rest of the development. **There is no need to feature-freeze during the migration!** + +[//]: # (TODO: show how to convert a KMongo collection to a KtMongo collection) + +## Query DSL and optional filters + +As we have seen above, the main difference KtMongo makes is to replace `vararg`-based functions by DSLs. This approach brings a few benefits. + +Let's write a query like we would have with KMongo: + +```kotlin +songs.find { + and { + Song::artist / Artist::name eq "Zutomayo" + Song::title eq "Truth in lies" + } +} +``` + +We can simplify this query by removing the `$and` operator: it is implied when a `find` contains multiple filters. + +```kotlin +songs.find { + Song::artist / Artist::name eq "Zutomayo" + Song::title eq "Truth in lies" +} +``` + +Another improvement is the introduction of operators to handle optional filter criteria. For example, with KMongo, if we wanted to make a request and optionally filter by a date, we could write: + +```kotlin title="Using KMongo" +songs.find( + and( + buildList { + add(Song::artist / Artist::name eq artistName) + + if (minDate != null) + add(Song::releaseDate gte minDate) + + if (maxDate != null) + add(Song::releaseDate lte maxDate) + } + ) +) +``` + +The DSL approach by itself eliminates most of the boilerplate of this request, because it allows us to use conditionals directly in the request body: + +```kotlin title="Using KtMongo" +songs.find { + Song::artist / Artist::name eq artistName + + if (minDate != null) + Song::releaseDate gte minDate + + if (maxDate != null) + Song::releaseDate lte maxDate +} +``` + +This is great for building complex queries that have a different structure each time they are called. Loops, conditions, and any other Kotlin language features are available directly in the DSL. + +The specific use-case of optional filters is quite common, so KtMongo provides a purpose-built operator variant: the `notNull` operators apply to the request only if their argument is non-`null`. Using them, we can simplify the request further: + +```kotlin title="Using KtMongo" +songs.find { + Song::artist / Artist::name eq artistName + Song::releaseDate gte minDate + Song::releaseDate lte maxDate +} +``` + +## Avoid using an operator in the wrong context + +## Avoid using expressions that do not match the current collection diff --git a/docs/website/mkdocs.yml b/docs/website/mkdocs.yml index fa4a524..023aa00 100644 --- a/docs/website/mkdocs.yml +++ b/docs/website/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: KtMongo +site_name: KtMongo (experimental) site_author: 4SH & contributors site_description: > Towards the future of MongoDB in Kotlin. @@ -47,14 +47,14 @@ theme: - media: "(prefers-color-scheme: light)" scheme: default primary: green - accent: cyan + accent: teal toggle: icon: material/brightness-7 name: "Light theme (click to switch to dark)" - media: "(prefers-color-scheme: dark)" scheme: slate primary: green - accent: cyan + accent: teal toggle: icon: material/brightness-4 name: "Dark theme (click to switch to system)" @@ -83,6 +83,13 @@ use_directory_urls: false nav: - Home: index.md - - Getting started: [ ] + - Getting started: + - guides/overview.md + - guides/setup.md + - guides/search.md - - Migrating from KMongo: [ ] + - Migrating from KMongo: + - migrate-from-kmongo/why.md + - migrate-from-kmongo/setup.md + - migrate-from-kmongo/search.md + - migrate-from-kmongo/nested-fields.md diff --git a/docs/website/overrides/home.html b/docs/website/overrides/home.html index b161425..b6dd936 100644 --- a/docs/website/overrides/home.html +++ b/docs/website/overrides/home.html @@ -5,14 +5,13 @@ #hero-page { width: 59rem; max-width: 100%; - min-height: 75vh; margin-left: auto; margin-right: auto; } #hero-title { font-size: 3.7rem; - margin-top: 30vh; + margin-top: 10vh; margin-bottom: 1rem; font-weight: bolder; } @@ -36,23 +35,8 @@

{{ config.site_name }}

-

{{ config.site_description }}

-
- - - What is it? - - - - Visit reference - - - - Visit repository -
From fcde2454c54f841fd1557e9379bebb4dd327c864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Fri, 12 Jul 2024 23:33:39 +0200 Subject: [PATCH 5/5] TMP PROTOTYPE EMBED REFERENCE IN THE DOCUMENTATION WEBSITE --- .../-compound-expression/-companion/index.md | 6 + .../-compound-expression.md | 6 + .../-compound-expression/accept.md | 19 +++ .../-compound-expression/index.md | 45 +++++++ .../-compound-expression/simplify.md | 15 +++ .../-expression/-companion/index.md | 6 + .../-expression/-expression.md | 6 + .../-expression/freeze.md | 11 ++ .../-expression/index.md | 44 +++++++ .../-expression/simplify.md | 15 +++ .../-expression/to-string.md | 15 +++ .../-expression/write-to.md | 13 ++ .../accept-all.md | 13 ++ .../fr.qsh.ktmongo.dsl.expr.common/index.md | 17 +++ .../with-logged-context.md | 6 + .../-filter-expression/-filter-expression.md | 6 + .../-filter-expression/and.md | 35 +++++ .../-filter-expression/does-not-exist.md | 33 +++++ .../-filter-expression/eq-not-null.md | 40 ++++++ .../-filter-expression/eq.md | 26 ++++ .../-filter-expression/exists.md | 33 +++++ .../-filter-expression/gt-not-null.md | 35 +++++ .../-filter-expression/gt.md | 32 +++++ .../-filter-expression/gte-not-null.md | 35 +++++ .../-filter-expression/gte.md | 32 +++++ .../-filter-expression/has-type.md | 35 +++++ .../-filter-expression/index.md | 50 +++++++ .../-filter-expression/invoke.md | 31 +++++ .../-filter-expression/is-not-null.md | 32 +++++ .../-filter-expression/is-not-undefined.md | 32 +++++ .../-filter-expression/is-null.md | 33 +++++ .../-filter-expression/is-one-of.md | 63 +++++++++ .../-filter-expression/is-undefined.md | 32 +++++ .../-filter-expression/lt-not-null.md | 35 +++++ .../-filter-expression/lt.md | 32 +++++ .../-filter-expression/lte-not-null.md | 35 +++++ .../-filter-expression/lte.md | 32 +++++ .../-filter-expression/ne.md | 34 +++++ .../-filter-expression/not.md | 28 ++++ .../-filter-expression/or.md | 36 +++++ .../-predicate-expression.md | 6 + .../-predicate-expression/does-not-exist.md | 36 +++++ .../-predicate-expression/eq-not-null.md | 45 +++++++ .../-predicate-expression/eq.md | 34 +++++ .../-predicate-expression/exists.md | 36 +++++ .../-predicate-expression/gt-not-null.md | 35 +++++ .../-predicate-expression/gt.md | 33 +++++ .../-predicate-expression/gte-not-null.md | 35 +++++ .../-predicate-expression/gte.md | 33 +++++ .../-predicate-expression/has-type.md | 38 ++++++ .../-predicate-expression/index.md | 45 +++++++ .../-predicate-expression/is-not-null.md | 33 +++++ .../-predicate-expression/is-not-undefined.md | 33 +++++ .../-predicate-expression/is-null.md | 34 +++++ .../-predicate-expression/is-one-of.md | 65 +++++++++ .../-predicate-expression/is-undefined.md | 33 +++++ .../-predicate-expression/lt-not-null.md | 35 +++++ .../-predicate-expression/lt.md | 33 +++++ .../-predicate-expression/lte-not-null.md | 35 +++++ .../-predicate-expression/lte.md | 33 +++++ .../-predicate-expression/ne.md | 36 +++++ .../-predicate-expression/not.md | 36 +++++ .../dsl/fr.qsh.ktmongo.dsl.expr/index.md | 10 ++ .../-path-segment/-all-positional/index.md | 21 +++ .../-all-positional/to-string.md | 6 + .../-path-segment/-field/-field.md | 6 + .../-path-segment/-field/index.md | 30 +++++ .../-path-segment/-field/name.md | 6 + .../-path-segment/-field/to-string.md | 6 + .../-path-segment/-indexed/--index--.md | 6 + .../-path-segment/-indexed/-indexed.md | 6 + .../-path-segment/-indexed/index.md | 30 +++++ .../-path-segment/-indexed/to-string.md | 6 + .../-path-segment/-positional/index.md | 23 ++++ .../-path-segment/-positional/to-string.md | 6 + .../-path-segment/index.md | 31 +++++ .../-path/-companion/index.md | 12 ++ .../-path/-companion/root.md | 9 ++ .../fr.qsh.ktmongo.dsl.path/-path/-path.md | 6 + .../-path/as-sequence.md | 6 + .../fr.qsh.ktmongo.dsl.path/-path/index.md | 48 +++++++ .../fr.qsh.ktmongo.dsl.path/-path/parent.md | 6 + .../fr.qsh.ktmongo.dsl.path/-path/segment.md | 6 + .../-path/to-string.md | 6 + .../-property-path/-property-path.md | 15 +++ .../-property-path/annotations.md | 6 + .../-property-path/call-by.md | 6 + .../-property-path/call.md | 6 + .../-property-path/get-delegate.md | 6 + .../-property-path/get.md | 6 + .../-property-path/getter.md | 6 + .../-property-path/index.md | 60 +++++++++ .../-property-path/invoke.md | 6 + .../-property-path/is-abstract.md | 6 + .../-property-path/is-const.md | 6 + .../-property-path/is-final.md | 6 + .../-property-path/is-lateinit.md | 6 + .../-property-path/is-open.md | 6 + .../-property-path/is-suspend.md | 6 + .../-property-path/name.md | 6 + .../-property-path/parameters.md | 6 + .../-property-path/return-type.md | 6 + .../-property-path/to-string.md | 6 + .../-property-path/type-parameters.md | 6 + .../-property-path/visibility.md | 6 + .../dsl/fr.qsh.ktmongo.dsl.path/div.md | 40 ++++++ .../dsl/fr.qsh.ktmongo.dsl.path/get.md | 35 +++++ .../dsl/fr.qsh.ktmongo.dsl.path/index.md | 20 +++ .../dsl/fr.qsh.ktmongo.dsl.path/path.md | 9 ++ .../dsl/fr.qsh.ktmongo.dsl.path/plus.md | 9 ++ .../fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md | 10 ++ .../-low-level-api/index.md | 12 ++ .../dsl/fr.qsh.ktmongo.dsl/index.md | 10 ++ .../docs/reference-dsl/dsl/package-list | 123 ++++++++++++++++++ docs/website/docs/reference-dsl/index.md | 12 ++ docs/website/mkdocs.yml | 39 ++++++ 116 files changed, 2666 insertions(+) create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-companion/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-compound-expression.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-companion/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-expression.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/simplify.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/accept-all.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/with-logged-context.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/-filter-expression.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/and.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/does-not-exist.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/exists.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/has-type.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/invoke.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-undefined.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-undefined.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/ne.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/not.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/or.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/-predicate-expression.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/does-not-exist.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/exists.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/has-type.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-undefined.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-one-of.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-undefined.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte-not-null.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/ne.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/not.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/-field.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/name.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/--index--.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/-indexed.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/root.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-path.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/as-sequence.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/parent.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/segment.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/-property-path.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/annotations.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call-by.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get-delegate.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/getter.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/invoke.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-abstract.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-const.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-final.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-lateinit.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-open.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-suspend.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/name.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/parameters.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/return-type.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/to-string.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/type-parameters.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/visibility.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/div.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/get.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/path.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/plus.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-low-level-api/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/index.md create mode 100644 docs/website/docs/reference-dsl/dsl/package-list create mode 100644 docs/website/docs/reference-dsl/index.md diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-companion/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-companion/index.md new file mode 100644 index 0000000..b498399 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-companion/index.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../../index.md)/[CompoundExpression](../index.md)/[Companion](index.md) + +# Companion + +[jvm]\ +object [Companion](index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-compound-expression.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-compound-expression.md new file mode 100644 index 0000000..1ad15cd --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-compound-expression.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[CompoundExpression](index.md)/[CompoundExpression](-compound-expression.md) + +# CompoundExpression + +[jvm]\ +constructor(codec: CodecRegistry) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md new file mode 100644 index 0000000..e1dc926 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md @@ -0,0 +1,19 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[CompoundExpression](index.md)/[accept](accept.md) + +# accept + +[jvm]\ + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +fun [accept](accept.md)(expression: [Expression](../-expression/index.md)) + +Binds an arbitrary [expression](accept.md) as a sub-expression of the receiver. + +### Security and correctness + +This function makes no verification on the validity of the passed expression. It is added to this expression as-is. + +This function is only publicly available to allow users to add missing operators themselves by implementing [Expression](../-expression/index.md) for their operator. + +**An incorrectly written expression may allow arbitrary code execution on the database, data corruption, or data leaks. Only call this function on expressions you are sure are implemented correctly!** diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md new file mode 100644 index 0000000..37a944b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md @@ -0,0 +1,45 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[CompoundExpression](index.md) + +# CompoundExpression + +abstract class [CompoundExpression](index.md)(codec: CodecRegistry) : [Expression](../-expression/index.md) + +A compound node in the BSON AST. This class is an implementation detail of all operator DSLs. + +This class adds the method [accept](accept.md) which allows binding a child expression into the current one. It manages the bound expressions internally, only giving the implementations access to them when simplify or write are called. + +#### See also + +| | +|---------------------------------------| +| [Expression](../-expression/index.md) | + +#### Inheritors + +| | +|-------------------------------------------------------------------------------------| +| [FilterExpression](../../fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md) | +| [PredicateExpression](../../fr.qsh.ktmongo.dsl.expr/-predicate-expression/index.md) | + +## Constructors + +| | | +|-----------------------------------------------|--------------------------------------------| +| [CompoundExpression](-compound-expression.md) | [jvm]
constructor(codec: CodecRegistry) | + +## Types + +| Name | Summary | +|----------------------------------|--------------------------------------------------| +| [Companion](-companion/index.md) | [jvm]
object [Companion](-companion/index.md) | + +## Functions + +| Name | Summary | +|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [accept](accept.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [accept](accept.md)(expression: [Expression](../-expression/index.md))
Binds an arbitrary [expression](accept.md) as a sub-expression of the receiver. | +| [acceptAll](../accept-all.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [CompoundExpression](index.md).[acceptAll](../accept-all.md)(expressions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<[Expression](../-expression/index.md)>)
Binds any arbitrary [expressions](../accept-all.md) as sub-expressions of the receiver. | +| [freeze](../-expression/freeze.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [freeze](../-expression/freeze.md)()
Forbid further mutations to this expression. | +| [simplify](simplify.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
override fun [simplify](simplify.md)(): [Expression](../-expression/index.md)?
Allows the implementation to replace itself by another more appropriate representation. | +| [toString](../-expression/to-string.md) | [jvm]
override fun [toString](../-expression/to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node, generated using [writeTo](../-expression/write-to.md).
[jvm]
fun [toString](../-expression/to-string.md)(simplified: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node. | +| [writeTo](../-expression/write-to.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [writeTo](../-expression/write-to.md)(writer: BsonWriter)
Writes this expression into a [writer](../-expression/write-to.md). | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md new file mode 100644 index 0000000..291a35b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md @@ -0,0 +1,15 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[CompoundExpression](index.md)/[simplify](simplify.md) + +# simplify + +[jvm]\ + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +override fun [simplify](simplify.md)(): [Expression](../-expression/index.md)? + +Allows the implementation to replace itself by another more appropriate representation. + +For example, if the current node is an `$and` operator with a single child, it may use this function to replace itself by that child. + +**Implementations must be pure.** diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-companion/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-companion/index.md new file mode 100644 index 0000000..e4f1b49 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-companion/index.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../../index.md)/[Expression](../index.md)/[Companion](index.md) + +# Companion + +[jvm]\ +object [Companion](index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-expression.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-expression.md new file mode 100644 index 0000000..8c6838e --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-expression.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[Expression](index.md)/[Expression](-expression.md) + +# Expression + +[jvm]\ +constructor(codec: CodecRegistry) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md new file mode 100644 index 0000000..caa1c68 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md @@ -0,0 +1,11 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[Expression](index.md)/[freeze](freeze.md) + +# freeze + +[jvm]\ + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +fun [freeze](freeze.md)() + +Forbid further mutations to this expression. diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/index.md new file mode 100644 index 0000000..972f277 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/index.md @@ -0,0 +1,44 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[Expression](index.md) + +# Expression + +abstract class [Expression](index.md)(codec: CodecRegistry) + +A node in the BSON AST. + +Each node knows how to [writeTo](write-to.md) itself into the expression. + +### Security + +Implementing this interface allows to inject arbitrary BSON into a request. Be very careful not to allow request injections. + +### Debugging notes + +Use [toString](to-string.md) to generate the JSON of this expression. + +#### Inheritors + +| | +|--------------------------------------------------------| +| [CompoundExpression](../-compound-expression/index.md) | + +## Constructors + +| | | +|------------------------------|--------------------------------------------| +| [Expression](-expression.md) | [jvm]
constructor(codec: CodecRegistry) | + +## Types + +| Name | Summary | +|----------------------------------|--------------------------------------------------| +| [Companion](-companion/index.md) | [jvm]
object [Companion](-companion/index.md) | + +## Functions + +| Name | Summary | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [freeze](freeze.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [freeze](freeze.md)()
Forbid further mutations to this expression. | +| [simplify](simplify.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
open fun [simplify](simplify.md)(): [Expression](index.md)?
Allows the implementation to replace itself by another more appropriate representation. | +| [toString](to-string.md) | [jvm]
override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node, generated using [writeTo](write-to.md).
[jvm]
fun [toString](to-string.md)(simplified: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node. | +| [writeTo](write-to.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [writeTo](write-to.md)(writer: BsonWriter)
Writes this expression into a [writer](write-to.md). | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/simplify.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/simplify.md new file mode 100644 index 0000000..b0e7505 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/simplify.md @@ -0,0 +1,15 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[Expression](index.md)/[simplify](simplify.md) + +# simplify + +[jvm]\ + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +open fun [simplify](simplify.md)(): [Expression](index.md)? + +Allows the implementation to replace itself by another more appropriate representation. + +For example, if the current node is an `$and` operator with a single child, it may use this function to replace itself by that child. + +**Implementations must be pure.** diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md new file mode 100644 index 0000000..623e998 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md @@ -0,0 +1,15 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[Expression](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +fun [toString](to-string.md)(simplified: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) + +Returns a JSON representation of this node. + +If [simplified](to-string.md) is `true`, [simplifications](simplify.md) are executed before printing. + +[jvm]\ +override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) + +Returns a JSON representation of this node, generated using [writeTo](write-to.md). diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md new file mode 100644 index 0000000..86c24bf --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md @@ -0,0 +1,13 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](../index.md)/[Expression](index.md)/[writeTo](write-to.md) + +# writeTo + +[jvm]\ + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +fun [writeTo](write-to.md)(writer: BsonWriter) + +Writes this expression into a [writer](write-to.md). + +This function is guaranteed to be pure. diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/accept-all.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/accept-all.md new file mode 100644 index 0000000..03346d8 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/accept-all.md @@ -0,0 +1,13 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](index.md)/[acceptAll](accept-all.md) + +# acceptAll + +[jvm]\ + +@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +fun [CompoundExpression](-compound-expression/index.md).[acceptAll](accept-all.md)(expressions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<[Expression](-expression/index.md)>) + +Binds any arbitrary [expressions](accept-all.md) as sub-expressions of the receiver. + +To learn more about the security implications, see [CompoundExpression.accept](-compound-expression/accept.md). diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/index.md new file mode 100644 index 0000000..8c1ba99 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/index.md @@ -0,0 +1,17 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](index.md) + +# Package-level declarations + +## Types + +| Name | Summary | +|-----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [CompoundExpression](-compound-expression/index.md) | [jvm]
abstract class [CompoundExpression](-compound-expression/index.md)(codec: CodecRegistry) : [Expression](-expression/index.md)
A compound node in the BSON AST. This class is an implementation detail of all operator DSLs. | +| [Expression](-expression/index.md) | [jvm]
abstract class [Expression](-expression/index.md)(codec: CodecRegistry)
A node in the BSON AST. | + +## Functions + +| Name | Summary | +|---------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [acceptAll](accept-all.md) | [jvm]
@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [CompoundExpression](-compound-expression/index.md).[acceptAll](accept-all.md)(expressions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<[Expression](-expression/index.md)>)
Binds any arbitrary [expressions](accept-all.md) as sub-expressions of the receiver. | +| [withLoggedContext](with-logged-context.md) | [jvm]
fun BsonWriter.[withLoggedContext](with-logged-context.md)(storeLogs: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = true): BsonWriter | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/with-logged-context.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/with-logged-context.md new file mode 100644 index 0000000..abe89fb --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr.common/with-logged-context.md @@ -0,0 +1,6 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.expr.common](index.md)/[withLoggedContext](with-logged-context.md) + +# withLoggedContext + +[jvm]\ +fun BsonWriter.[withLoggedContext](with-logged-context.md)(storeLogs: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = true): BsonWriter diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/-filter-expression.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/-filter-expression.md new file mode 100644 index 0000000..11b4af6 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/-filter-expression.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[FilterExpression](-filter-expression.md) + +# FilterExpression + +[jvm]\ +constructor(codec: CodecRegistry) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/and.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/and.md new file mode 100644 index 0000000..d4703c9 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/and.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[and](and.md) + +# and + +[jvm]\ +fun [and](and.md)(block: [FilterExpression](index.md)<[T](index.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)) + +Performs a logical `AND` operation on one or more expressions, and selects the documents that satisfy *all* the expressions. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.findOne { + and { + User::name eq "foo" + User::age eq 18 + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/and/) + +#### See also + +| | | +|------------------------------|-------------------------| +| [FilterExpression.or](or.md) | Logical `OR` operation. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/does-not-exist.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/does-not-exist.md new file mode 100644 index 0000000..cc24565 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/does-not-exist.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[doesNotExist](does-not-exist.md) + +# doesNotExist + +[jvm]\ +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[doesNotExist](does-not-exist.md)() + +Matches documents that do not contain the specified field. Documents where the field if `null` are not matched. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::age.doesNotExist() +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/exists/) + +#### See also + +| | | +|---------------------------------------|------------------------------------------------------| +| [FilterExpression.exists](exists.md) | Opposite. | +| [FilterExpression.isNull](is-null.md) | Only matches documents that are specifically `null`. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq-not-null.md new file mode 100644 index 0000000..112c5b8 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq-not-null.md @@ -0,0 +1,40 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[eqNotNull](eq-not-null.md) + +# eqNotNull + +[jvm]\ +infix fun <[V](eq-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](eq-not-null.md)>.[eqNotNull](eq-not-null.md)(value: [V](eq-not-null.md)?) + +Matches documents where the value of a field equals [value](eq-not-null.md). + +If [value](eq-not-null.md) is `null`, the operator is not added (all documents are matched). + +### Example + +This operator is useful to simplify searches when the criteria is optional. For example, instead of writing: + +```kotlin +collection.find { + if (criteria.name != null) + User::name eq criteria.name +} +``` + +this operator can be used instead: + +```kotlin +collection.find { + User::name eqNotNull criteria.name +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + +#### See also + +| | | +|------------------------------|------------------| +| [FilterExpression.eq](eq.md) | Equality filter. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq.md new file mode 100644 index 0000000..e8e9d33 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq.md @@ -0,0 +1,26 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[eq](eq.md) + +# eq + +[jvm]\ +infix fun <[V](eq.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](eq.md)>.[eq](eq.md)(value: [V](eq.md)) + +Matches documents where the value of a field equals the [value](eq.md). + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name eq "foo" +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/exists.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/exists.md new file mode 100644 index 0000000..2317516 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/exists.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[exists](exists.md) + +# exists + +[jvm]\ +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[exists](exists.md)() + +Matches documents that contain the specified field, including values where the field value is `null`. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::age.exists() +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/exists/) + +#### See also + +| | | +|----------------------------------------------------|-------------------------------------------------------------------| +| [FilterExpression.doesNotExist](does-not-exist.md) | Opposite. | +| [FilterExpression.isNotNull](is-not-null.md) | Identical, but does not match elements where the field is `null`. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt-not-null.md new file mode 100644 index 0000000..a4b7ac4 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[gtNotNull](gt-not-null.md) + +# gtNotNull + +[jvm]\ +infix fun <[V](gt-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gt-not-null.md)>.[gtNotNull](gt-not-null.md)(value: [V](gt-not-null.md)?) + +Selects documents for which this field has a value strictly greater than [value](gt-not-null.md). + +If [value](gt-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age gtNotNull 10 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + +#### See also + +| | +|----------------------------------------------| +| [FilterExpression.gt](gt.md) | +| [FilterExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt.md new file mode 100644 index 0000000..3544bfa --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[gt](gt.md) + +# gt + +[jvm]\ +infix fun <[V](gt.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gt.md)>.[gt](gt.md)(value: [V](gt.md)) + +Selects documents for which this field has a value strictly greater than [value](gt.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age gt 18 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + +#### See also + +| | +|----------------------------------------------| +| [FilterExpression.gtNotNull](gt-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte-not-null.md new file mode 100644 index 0000000..01f663d --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[gteNotNull](gte-not-null.md) + +# gteNotNull + +[jvm]\ +infix fun <[V](gte-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gte-not-null.md)>.[gteNotNull](gte-not-null.md)(value: [V](gte-not-null.md)?) + +Selects documents for which this field has a value greater or equal to [value](gte-not-null.md). + +If [value](gte-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age gteNotNull 10 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + +#### See also + +| | | +|----------------------------------------------|-----------------------------------------| +| [FilterExpression.gte](gte.md) | | +| [FilterExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte.md new file mode 100644 index 0000000..9acfaa5 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[gte](gte.md) + +# gte + +[jvm]\ +infix fun <[V](gte.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gte.md)>.[gte](gte.md)(value: [V](gte.md)) + +Selects documents for which this field has a value greater or equal to [value](gte.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age gte 18 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + +#### See also + +| | +|------------------------------------------------| +| [FilterExpression.gteNotNull](gte-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/has-type.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/has-type.md new file mode 100644 index 0000000..0e8c54b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/has-type.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[hasType](has-type.md) + +# hasType + +[jvm]\ +infix fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[hasType](has-type.md)(type: BsonType) + +Selects documents where the value of the field is an instance of the specified BSON [type](has-type.md). + +Querying by data type is useful when dealing with highly unstructured data where data types are not predictable. + +### Example + +```kotlin +class User( + val name: String, + val age: Any, +) + +collection.find { + User::age hasType BsonType.STRING +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/type/) + +#### See also + +| | | +|-------------------------------------------------|----------------------------------------------------| +| [FilterExpression.isNull](is-null.md) | Checks if a value has the type BsonType.NULL. | +| [FilterExpression.isUndefined](is-undefined.md) | Checks if a value has the type BsonType.UNDEFINED. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md new file mode 100644 index 0000000..3fca503 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md @@ -0,0 +1,50 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md) + +# FilterExpression + +[jvm]\ +class [FilterExpression](index.md)<[T](index.md)>(codec: CodecRegistry) : [CompoundExpression](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md) + +DSL for MongoDB operators that are used as predicates in conditions. + +For example, these operators are available when querying with `find`, or as the filter in `updateOne`. + +## Constructors + +| | | +|-------------------------------------------|--------------------------------------------| +| [FilterExpression](-filter-expression.md) | [jvm]
constructor(codec: CodecRegistry) | + +## Functions + +| Name | Summary | +|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [accept](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [accept](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md)(expression: [Expression](../../fr.qsh.ktmongo.dsl.expr.common/-expression/index.md))
Binds an arbitrary [expression](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md) as a sub-expression of the receiver. | +| [acceptAll](../../fr.qsh.ktmongo.dsl.expr.common/accept-all.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [CompoundExpression](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md).[acceptAll](../../fr.qsh.ktmongo.dsl.expr.common/accept-all.md)(expressions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<[Expression](../../fr.qsh.ktmongo.dsl.expr.common/-expression/index.md)>)
Binds any arbitrary [expressions](../../fr.qsh.ktmongo.dsl.expr.common/accept-all.md) as sub-expressions of the receiver. | +| [and](and.md) | [jvm]
fun [and](and.md)(block: [FilterExpression](index.md)<[T](index.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html))
Performs a logical `AND` operation on one or more expressions, and selects the documents that satisfy *all* the expressions. | +| [doesNotExist](does-not-exist.md) | [jvm]
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[doesNotExist](does-not-exist.md)()
Matches documents that do not contain the specified field. Documents where the field if `null` are not matched. | +| [eq](eq.md) | [jvm]
infix fun <[V](eq.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](eq.md)>.[eq](eq.md)(value: [V](eq.md))
Matches documents where the value of a field equals the [value](eq.md). | +| [eqNotNull](eq-not-null.md) | [jvm]
infix fun <[V](eq-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](eq-not-null.md)>.[eqNotNull](eq-not-null.md)(value: [V](eq-not-null.md)?)
Matches documents where the value of a field equals [value](eq-not-null.md). | +| [exists](exists.md) | [jvm]
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[exists](exists.md)()
Matches documents that contain the specified field, including values where the field value is `null`. | +| [freeze](../../fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [freeze](../../fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md)()
Forbid further mutations to this expression. | +| [gt](gt.md) | [jvm]
infix fun <[V](gt.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gt.md)>.[gt](gt.md)(value: [V](gt.md))
Selects documents for which this field has a value strictly greater than [value](gt.md). | +| [gte](gte.md) | [jvm]
infix fun <[V](gte.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gte.md)>.[gte](gte.md)(value: [V](gte.md))
Selects documents for which this field has a value greater or equal to [value](gte.md). | +| [gteNotNull](gte-not-null.md) | [jvm]
infix fun <[V](gte-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gte-not-null.md)>.[gteNotNull](gte-not-null.md)(value: [V](gte-not-null.md)?)
Selects documents for which this field has a value greater or equal to [value](gte-not-null.md). | +| [gtNotNull](gt-not-null.md) | [jvm]
infix fun <[V](gt-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](gt-not-null.md)>.[gtNotNull](gt-not-null.md)(value: [V](gt-not-null.md)?)
Selects documents for which this field has a value strictly greater than [value](gt-not-null.md). | +| [hasType](has-type.md) | [jvm]
infix fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[hasType](has-type.md)(type: BsonType)
Selects documents where the value of the field is an instance of the specified BSON [type](has-type.md). | +| [invoke](invoke.md) | [jvm]
operator fun <[V](invoke.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](invoke.md)>.[invoke](invoke.md)(block: [PredicateExpression](../-predicate-expression/index.md)<[V](invoke.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html))
Targets a single field to execute a [targeted predicate](../-predicate-expression/index.md). | +| [isNotNull](is-not-null.md) | [jvm]
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isNotNull](is-not-null.md)()
Selects documents for which the field is not `null`. | +| [isNotUndefined](is-not-undefined.md) | [jvm]
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isNotUndefined](is-not-undefined.md)()
Selects documents for which the field is not `undefined`. | +| [isNull](is-null.md) | [jvm]
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isNull](is-null.md)()
Selects documents for which the field is `null`. | +| [isOneOf](is-one-of.md) | [jvm]
fun <[V](is-one-of.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](is-one-of.md)>.[isOneOf](is-one-of.md)(vararg values: [V](is-one-of.md))
fun <[V](is-one-of.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](is-one-of.md)>.[isOneOf](is-one-of.md)(values: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[V](is-one-of.md)>)
Selects documents for which this field is equal to one of the given [values](is-one-of.md). | +| [isUndefined](is-undefined.md) | [jvm]
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isUndefined](is-undefined.md)()
Selects documents for which the field is `undefined`. | +| [lt](lt.md) | [jvm]
infix fun <[V](lt.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lt.md)>.[lt](lt.md)(value: [V](lt.md))
Selects documents for which this field has a value strictly lesser than [value](lt.md). | +| [lte](lte.md) | [jvm]
infix fun <[V](lte.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lte.md)>.[lte](lte.md)(value: [V](lte.md))
Selects documents for which this field has a value lesser or equal to [value](lte.md). | +| [lteNotNull](lte-not-null.md) | [jvm]
infix fun <[V](lte-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lte-not-null.md)>.[lteNotNull](lte-not-null.md)(value: [V](lte-not-null.md)?)
Selects documents for which this field has a value lesser or equal to [value](lte-not-null.md). | +| [ltNotNull](lt-not-null.md) | [jvm]
infix fun <[V](lt-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lt-not-null.md)>.[ltNotNull](lt-not-null.md)(value: [V](lt-not-null.md)?)
Selects documents for which this field has a value strictly lesser than [value](lt-not-null.md). | +| [ne](ne.md) | [jvm]
infix fun <[V](ne.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](ne.md)>.[ne](ne.md)(value: [V](ne.md))
Matches documents where the value of a field does not equal the [value](ne.md). | +| [not](not.md) | [jvm]
infix fun <[V](not.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](not.md)>.[not](not.md)(expression: [PredicateExpression](../-predicate-expression/index.md)<[V](not.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html))
Performs a logical `NOT` operation on the specified [expression](not.md) and selects the documents that *do not* match the expression. This includes the elements that do not contain the field. | +| [or](or.md) | [jvm]
fun [or](or.md)(block: [FilterExpression](index.md)<[T](index.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html))
Performs a logical `OR` operation on one or more expressions, and selects the documents that satisfy *at least one* of the expressions. | +| [simplify](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
override fun [simplify](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md)(): [Expression](../../fr.qsh.ktmongo.dsl.expr.common/-expression/index.md)?
Allows the implementation to replace itself by another more appropriate representation. | +| [toString](../../fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md) | [jvm]
override fun [toString](../../fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node, generated using [writeTo](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md).
[jvm]
fun [toString](../../fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md)(simplified: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node. | +| [writeTo](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [writeTo](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md)(writer: BsonWriter)
Writes this expression into a [writer](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md). | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/invoke.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/invoke.md new file mode 100644 index 0000000..d04d1e2 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/invoke.md @@ -0,0 +1,31 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[invoke](invoke.md) + +# invoke + +[jvm]\ +operator fun <[V](invoke.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](invoke.md)>.[invoke](invoke.md)(block: [PredicateExpression](../-predicate-expression/index.md)<[V](invoke.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)) + +Targets a single field to execute a [targeted predicate](../-predicate-expression/index.md). + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name { + eq("foo") + } +} +``` + +Note that many operators available this way have a convenience function directly in this class to shorten this. For this example, see [eq](eq.md): + +```kotlin +collection.find { + User::name eq "foo" +} +``` diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-null.md new file mode 100644 index 0000000..f5d31b4 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-null.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[isNotNull](is-not-null.md) + +# isNotNull + +[jvm]\ +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isNotNull](is-not-null.md)() + +Selects documents for which the field is not `null`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age.isNotNull() +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|---------------------------------------|-----------| +| [FilterExpression.isNull](is-null.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-undefined.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-undefined.md new file mode 100644 index 0000000..34f7036 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-undefined.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[isNotUndefined](is-not-undefined.md) + +# isNotUndefined + +[jvm]\ +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isNotUndefined](is-not-undefined.md)() + +Selects documents for which the field is not `undefined`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age.isNotUndefined() +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|-------------------------------------------------|-----------| +| [FilterExpression.isUndefined](is-undefined.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-null.md new file mode 100644 index 0000000..fed32dc --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-null.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[isNull](is-null.md) + +# isNull + +[jvm]\ +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isNull](is-null.md)() + +Selects documents for which the field is `null`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age.isNull() +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|----------------------------------------------------|---------------------------------| +| [FilterExpression.doesNotExist](does-not-exist.md) | Checks if the value is not set. | +| [FilterExpression.isNotNull](is-not-null.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md new file mode 100644 index 0000000..557a968 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md @@ -0,0 +1,63 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[isOneOf](is-one-of.md) + +# isOneOf + +[jvm]\ +fun <[V](is-one-of.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](is-one-of.md)>.[isOneOf](is-one-of.md)(values: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[V](is-one-of.md)>) + +Selects documents for which this field is equal to one of the given [values](is-one-of.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::name.isOneOf(listOf("Alfred", "Arthur")) +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) + +#### See also + +| | +|------------------------------| +| [FilterExpression.or](or.md) | +| [FilterExpression.eq](eq.md) | + +[jvm]\ +fun <[V](is-one-of.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](is-one-of.md)>.[isOneOf](is-one-of.md)(vararg values: [V](is-one-of.md)) + +Selects documents for which this field is equal to one of the given [values](is-one-of.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::name.isOneOf("Alfred", "Arthur") +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) + +#### See also + +| | +|------------------------------| +| [FilterExpression.or](or.md) | +| [FilterExpression.eq](eq.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-undefined.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-undefined.md new file mode 100644 index 0000000..cc5f5bc --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-undefined.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[isUndefined](is-undefined.md) + +# isUndefined + +[jvm]\ +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), *>.[isUndefined](is-undefined.md)() + +Selects documents for which the field is `undefined`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age.isUndefined() +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|--------------------------------------------------------|-----------| +| [FilterExpression.isNotUndefined](is-not-undefined.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt-not-null.md new file mode 100644 index 0000000..72ec4d9 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[ltNotNull](lt-not-null.md) + +# ltNotNull + +[jvm]\ +infix fun <[V](lt-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lt-not-null.md)>.[ltNotNull](lt-not-null.md)(value: [V](lt-not-null.md)?) + +Selects documents for which this field has a value strictly lesser than [value](lt-not-null.md). + +If [value](lt-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age ltNotNull 10 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + +#### See also + +| | +|----------------------------------------------| +| [FilterExpression.lt](lt.md) | +| [FilterExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt.md new file mode 100644 index 0000000..f1576c7 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[lt](lt.md) + +# lt + +[jvm]\ +infix fun <[V](lt.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lt.md)>.[lt](lt.md)(value: [V](lt.md)) + +Selects documents for which this field has a value strictly lesser than [value](lt.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age lt 18 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + +#### See also + +| | +|----------------------------------------------| +| [FilterExpression.ltNotNull](lt-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte-not-null.md new file mode 100644 index 0000000..8495e23 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[lteNotNull](lte-not-null.md) + +# lteNotNull + +[jvm]\ +infix fun <[V](lte-not-null.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lte-not-null.md)>.[lteNotNull](lte-not-null.md)(value: [V](lte-not-null.md)?) + +Selects documents for which this field has a value lesser or equal to [value](lte-not-null.md). + +If [value](lte-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age lteNotNull 10 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + +#### See also + +| | +|----------------------------------------------| +| [FilterExpression.lte](lte.md) | +| [FilterExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte.md new file mode 100644 index 0000000..4967f1f --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte.md @@ -0,0 +1,32 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[lte](lte.md) + +# lte + +[jvm]\ +infix fun <[V](lte.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](lte.md)>.[lte](lte.md)(value: [V](lte.md)) + +Selects documents for which this field has a value lesser or equal to [value](lte.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age lte 18 +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + +#### See also + +| | +|------------------------------------------------| +| [FilterExpression.lteNotNull](lte-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/ne.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/ne.md new file mode 100644 index 0000000..e5e546c --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/ne.md @@ -0,0 +1,34 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[ne](ne.md) + +# ne + +[jvm]\ +infix fun <[V](ne.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](ne.md)>.[ne](ne.md)(value: [V](ne.md)) + +Matches documents where the value of a field does not equal the [value](ne.md). + +The result includes documents which do not contain the specified field. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name ne "foo" +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/ne/) + +#### See also + +| | +|------------------------------| +| [FilterExpression.eq](eq.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/not.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/not.md new file mode 100644 index 0000000..8ff9e9b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/not.md @@ -0,0 +1,28 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[not](not.md) + +# not + +[jvm]\ +infix fun <[V](not.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T](index.md), [V](not.md)>.[not](not.md)(expression: [PredicateExpression](../-predicate-expression/index.md)<[V](not.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)) + +Performs a logical `NOT` operation on the specified [expression](not.md) and selects the documents that *do not* match the expression. This includes the elements that do not contain the field. + +### Example + +```kotlin +class User( + val name: String, + val age: Int, +) + +collection.find { + User::age not { + hasType(BsonType.STRING) + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/not/) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/or.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/or.md new file mode 100644 index 0000000..fed42cd --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/or.md @@ -0,0 +1,36 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[FilterExpression](index.md)/[or](or.md) + +# or + +[jvm]\ +fun [or](or.md)(block: [FilterExpression](index.md)<[T](index.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)) + +Performs a logical `OR` operation on one or more expressions, and selects the documents that satisfy *at least one* of the expressions. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + or { + User::name eq "foo" + User::name eq "bar" + User::age eq 18 + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/or/) + +#### See also + +| | | +|--------------------------------|--------------------------| +| [FilterExpression.and](and.md) | Logical `AND` operation. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/-predicate-expression.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/-predicate-expression.md new file mode 100644 index 0000000..93cb639 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/-predicate-expression.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[PredicateExpression](-predicate-expression.md) + +# PredicateExpression + +[jvm]\ +constructor(codec: CodecRegistry) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/does-not-exist.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/does-not-exist.md new file mode 100644 index 0000000..8a43145 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/does-not-exist.md @@ -0,0 +1,36 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[doesNotExist](does-not-exist.md) + +# doesNotExist + +[jvm]\ +fun [doesNotExist](does-not-exist.md)() + +Matches documents that do not contain the specified field. Documents where the field if `null` are counted as existing. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name { + doesNotExist() + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/exists/) + +#### See also + +| | | +|--------------------------------------------------------------------------|-----------------------------------------------------| +| [FilterExpression.doesNotExist](../-filter-expression/does-not-exist.md) | Shorthand. | +| [PredicateExpression.exists](exists.md) | Opposite. | +| [PredicateExpression.isNull](is-null.md) | Only matches elements that are specifically `null`. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq-not-null.md new file mode 100644 index 0000000..25c82b3 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq-not-null.md @@ -0,0 +1,45 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[eqNotNull](eq-not-null.md) + +# eqNotNull + +[jvm]\ +fun [eqNotNull](eq-not-null.md)(value: [T](index.md)?) + +Matches documents where the value of a field equals [value](eq-not-null.md). + +If [value](eq-not-null.md) is `null`, the operator is not added (all documents are matched). + +### Example + +This operator is useful to simplify searches when the criteria is optional. For example, instead of writing: + +```kotlin +collection.find { + User::name { + if (criteria.name != null) + eq(criteria.name) + } +} +``` + +this operator can be used instead: + +```kotlin +collection.find { + User::name { + eqNotNull(criteria.name) + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + +#### See also + +| | | +|--------------------------------------------------------------------|------------------| +| [FilterExpression.eqNotNull](../-filter-expression/eq-not-null.md) | Shorthand. | +| [PredicateExpression.eq](eq.md) | Equality filter. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq.md new file mode 100644 index 0000000..02c37ab --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq.md @@ -0,0 +1,34 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[eq](eq.md) + +# eq + +[jvm]\ +fun [eq](eq.md)(value: [T](index.md)) + +Matches documents where the value of a field equals the [value](eq.md). + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name { + eq("foo") + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + +#### See also + +| | | +|----------------------------------------------------|------------| +| [FilterExpression.eq](../-filter-expression/eq.md) | Shorthand. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/exists.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/exists.md new file mode 100644 index 0000000..d180637 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/exists.md @@ -0,0 +1,36 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[exists](exists.md) + +# exists + +[jvm]\ +fun [exists](exists.md)() + +Matches documents that contain the specified field, including values where the field value is `null`. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name { + exists() + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/exists/) + +#### See also + +| | | +|------------------------------------------------------------|-------------------------------------------------------------------| +| [FilterExpression.exists](../-filter-expression/exists.md) | Shorthand. | +| [PredicateExpression.doesNotExist](does-not-exist.md) | Opposite. | +| [PredicateExpression.isNotNull](is-not-null.md) | Identical, but does not match elements where the field is `null`. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt-not-null.md new file mode 100644 index 0000000..9210afa --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[gtNotNull](gt-not-null.md) + +# gtNotNull + +[jvm]\ +fun [gtNotNull](gt-not-null.md)(value: [T](index.md)?) + +Selects documents for which this field has a value strictly greater than [value](gt-not-null.md). + +If [value](gt-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age { gtNotNull(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + +#### See also + +| | +|--------------------------------------------------------------------| +| [FilterExpression.gtNotNull](../-filter-expression/gt-not-null.md) | +| [PredicateExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt.md new file mode 100644 index 0000000..9cf23f1 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[gt](gt.md) + +# gt + +[jvm]\ +fun [gt](gt.md)(value: [T](index.md)) + +Selects documents for which this field has a value strictly greater than [value](gt.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { gt(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + +#### See also + +| | +|----------------------------------------------------| +| [FilterExpression.gt](../-filter-expression/gt.md) | +| [PredicateExpression.gtNotNull](gt-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte-not-null.md new file mode 100644 index 0000000..35b4aa1 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[gteNotNull](gte-not-null.md) + +# gteNotNull + +[jvm]\ +fun [gteNotNull](gte-not-null.md)(value: [T](index.md)?) + +Selects documents for which this field has a value greater or equal to [value](gte-not-null.md). + +If [value](gte-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age { gteNotNull(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + +#### See also + +| | +|----------------------------------------------------------------------| +| [FilterExpression.gteNotNull](../-filter-expression/gte-not-null.md) | +| [PredicateExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte.md new file mode 100644 index 0000000..b2a77fd --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[gte](gte.md) + +# gte + +[jvm]\ +fun [gte](gte.md)(value: [T](index.md)) + +Selects documents for which this field has a value greater or equal to [value](gte.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { gte(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + +#### See also + +| | +|------------------------------------------------------| +| [FilterExpression.gte](../-filter-expression/gte.md) | +| [PredicateExpression.gteNotNull](gte-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/has-type.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/has-type.md new file mode 100644 index 0000000..31bb8ff --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/has-type.md @@ -0,0 +1,38 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[hasType](has-type.md) + +# hasType + +[jvm]\ +fun [hasType](has-type.md)(type: BsonType) + +Selects documents where the value of the field is an instance of the specified BSON [type](has-type.md). + +Querying by data type is useful when dealing with highly unstructured data where data types are not predictable. + +### Example + +```kotlin +class User( + val name: String, + val age: Any, +) + +collection.find { + User::age { + type(BsonType.STRING) + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/type/) + +#### See also + +| | | +|---------------------------------------------------------------|----------------------------------------------------| +| [FilterExpression.hasType](../-filter-expression/has-type.md) | Shorthand. | +| [PredicateExpression.isNull](is-null.md) | Checks if a value has the type BsonType.NULL. | +| [PredicateExpression.isUndefined](is-undefined.md) | Checks if a value has the type BsonType.UNDEFINED. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/index.md new file mode 100644 index 0000000..d92952f --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/index.md @@ -0,0 +1,45 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md) + +# PredicateExpression + +[jvm]\ +class [PredicateExpression](index.md)<[T](index.md)>(codec: CodecRegistry) : [CompoundExpression](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md) + +DSL for MongoDB operators that are used as predicates in conditions in a context where the targeted field is already specified. + +## Constructors + +| | | +|-------------------------------------------------|--------------------------------------------| +| [PredicateExpression](-predicate-expression.md) | [jvm]
constructor(codec: CodecRegistry) | + +## Functions + +| Name | Summary | +|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [accept](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [accept](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md)(expression: [Expression](../../fr.qsh.ktmongo.dsl.expr.common/-expression/index.md))
Binds an arbitrary [expression](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md) as a sub-expression of the receiver. | +| [acceptAll](../../fr.qsh.ktmongo.dsl.expr.common/accept-all.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [CompoundExpression](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md).[acceptAll](../../fr.qsh.ktmongo.dsl.expr.common/accept-all.md)(expressions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<[Expression](../../fr.qsh.ktmongo.dsl.expr.common/-expression/index.md)>)
Binds any arbitrary [expressions](../../fr.qsh.ktmongo.dsl.expr.common/accept-all.md) as sub-expressions of the receiver. | +| [doesNotExist](does-not-exist.md) | [jvm]
fun [doesNotExist](does-not-exist.md)()
Matches documents that do not contain the specified field. Documents where the field if `null` are counted as existing. | +| [eq](eq.md) | [jvm]
fun [eq](eq.md)(value: [T](index.md))
Matches documents where the value of a field equals the [value](eq.md). | +| [eqNotNull](eq-not-null.md) | [jvm]
fun [eqNotNull](eq-not-null.md)(value: [T](index.md)?)
Matches documents where the value of a field equals [value](eq-not-null.md). | +| [exists](exists.md) | [jvm]
fun [exists](exists.md)()
Matches documents that contain the specified field, including values where the field value is `null`. | +| [freeze](../../fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [freeze](../../fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md)()
Forbid further mutations to this expression. | +| [gt](gt.md) | [jvm]
fun [gt](gt.md)(value: [T](index.md))
Selects documents for which this field has a value strictly greater than [value](gt.md). | +| [gte](gte.md) | [jvm]
fun [gte](gte.md)(value: [T](index.md))
Selects documents for which this field has a value greater or equal to [value](gte.md). | +| [gteNotNull](gte-not-null.md) | [jvm]
fun [gteNotNull](gte-not-null.md)(value: [T](index.md)?)
Selects documents for which this field has a value greater or equal to [value](gte-not-null.md). | +| [gtNotNull](gt-not-null.md) | [jvm]
fun [gtNotNull](gt-not-null.md)(value: [T](index.md)?)
Selects documents for which this field has a value strictly greater than [value](gt-not-null.md). | +| [hasType](has-type.md) | [jvm]
fun [hasType](has-type.md)(type: BsonType)
Selects documents where the value of the field is an instance of the specified BSON [type](has-type.md). | +| [isNotNull](is-not-null.md) | [jvm]
fun [isNotNull](is-not-null.md)()
Selects documents for which the field is not `null`. | +| [isNotUndefined](is-not-undefined.md) | [jvm]
fun [isNotUndefined](is-not-undefined.md)()
Selects documents for which the field is not `undefined`. | +| [isNull](is-null.md) | [jvm]
fun [isNull](is-null.md)()
Selects documents for which the field is `null`. | +| [isOneOf](is-one-of.md) | [jvm]
fun [isOneOf](is-one-of.md)(vararg values: [T](index.md))
fun [isOneOf](is-one-of.md)(values: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[T](index.md)>)
Selects documents for which this field is equal to one of the given [values](is-one-of.md). | +| [isUndefined](is-undefined.md) | [jvm]
fun [isUndefined](is-undefined.md)()
Selects documents for which the field is `undefined`. | +| [lt](lt.md) | [jvm]
fun [lt](lt.md)(value: [T](index.md))
Selects documents for which this field has a value strictly lesser than [value](lt.md). | +| [lte](lte.md) | [jvm]
fun [lte](lte.md)(value: [T](index.md))
Selects documents for which this field has a value lesser or equal to [value](lte.md). | +| [lteNotNull](lte-not-null.md) | [jvm]
fun [lteNotNull](lte-not-null.md)(value: [T](index.md)?)
Selects documents for which this field has a value lesser or equal to [value](lte-not-null.md). | +| [ltNotNull](lt-not-null.md) | [jvm]
fun [ltNotNull](lt-not-null.md)(value: [T](index.md)?)
Selects documents for which this field has a value strictly lesser than [value](lt-not-null.md). | +| [ne](ne.md) | [jvm]
fun [ne](ne.md)(value: [T](index.md))
Matches documents where the value of a field does not equal the [value](ne.md). | +| [not](not.md) | [jvm]
fun [not](not.md)(expression: [PredicateExpression](index.md)<[T](index.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html))
Performs a logical `NOT` operation on the specified [expression](not.md) and selects the documents that *do not* match the expression. This includes the elements that do not contain the field. | +| [simplify](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
override fun [simplify](../../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md)(): [Expression](../../fr.qsh.ktmongo.dsl.expr.common/-expression/index.md)?
Allows the implementation to replace itself by another more appropriate representation. | +| [toString](../../fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md) | [jvm]
override fun [toString](../../fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node, generated using [writeTo](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md).
[jvm]
fun [toString](../../fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md)(simplified: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Returns a JSON representation of this node. | +| [writeTo](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [writeTo](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md)(writer: BsonWriter)
Writes this expression into a [writer](../../fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md). | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-null.md new file mode 100644 index 0000000..2d9d705 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-null.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[isNotNull](is-not-null.md) + +# isNotNull + +[jvm]\ +fun [isNotNull](is-not-null.md)() + +Selects documents for which the field is not `null`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { isNotNull() } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|--------------------------------------------------------------------|------------| +| [FilterExpression.isNotNull](../-filter-expression/is-not-null.md) | Shorthand. | +| [PredicateExpression.isNull](is-null.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-undefined.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-undefined.md new file mode 100644 index 0000000..6919fbd --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-undefined.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[isNotUndefined](is-not-undefined.md) + +# isNotUndefined + +[jvm]\ +fun [isNotUndefined](is-not-undefined.md)() + +Selects documents for which the field is not `undefined`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { isNotUndefined() } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|------------------------------------------------------------------------------|------------| +| [FilterExpression.isNotUndefined](../-filter-expression/is-not-undefined.md) | Shorthand. | +| [PredicateExpression.isUndefined](is-undefined.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-null.md new file mode 100644 index 0000000..1d383af --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-null.md @@ -0,0 +1,34 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[isNull](is-null.md) + +# isNull + +[jvm]\ +fun [isNull](is-null.md)() + +Selects documents for which the field is `null`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { isNull() } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|-------------------------------------------------------------|---------------------------------| +| [FilterExpression.isNull](../-filter-expression/is-null.md) | Shorthand. | +| [PredicateExpression.doesNotExist](does-not-exist.md) | Checks if the value is not set. | +| [PredicateExpression.isNotNull](is-not-null.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-one-of.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-one-of.md new file mode 100644 index 0000000..29dea56 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-one-of.md @@ -0,0 +1,65 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[isOneOf](is-one-of.md) + +# isOneOf + +[jvm]\ +fun [isOneOf](is-one-of.md)(values: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[T](index.md)>) + +Selects documents for which this field is equal to one of the given [values](is-one-of.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::name { + isOneOf(listOf("Alfred", "Arthur")) + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) + +#### See also + +| | +|----------------------------------------------------------------| +| [FilterExpression.isOneOf](../-filter-expression/is-one-of.md) | + +[jvm]\ +fun [isOneOf](is-one-of.md)(vararg values: [T](index.md)) + +Selects documents for which this field is equal to one of the given [values](is-one-of.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::name { + isOneOf("Alfred", "Arthur") + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) + +#### See also + +| | +|----------------------------------------------------------------| +| [FilterExpression.isOneOf](../-filter-expression/is-one-of.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-undefined.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-undefined.md new file mode 100644 index 0000000..939dddc --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-undefined.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[isUndefined](is-undefined.md) + +# isUndefined + +[jvm]\ +fun [isUndefined](is-undefined.md)() + +Selects documents for which the field is `undefined`. + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { isUndefined() } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/tutorial/query-for-null-fields/#type-check) + +#### See also + +| | | +|-----------------------------------------------------------------------|------------| +| [FilterExpression.isUndefined](../-filter-expression/is-undefined.md) | Shorthand. | +| [PredicateExpression.isNotUndefined](is-not-undefined.md) | Opposite. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt-not-null.md new file mode 100644 index 0000000..b0cbc43 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[ltNotNull](lt-not-null.md) + +# ltNotNull + +[jvm]\ +fun [ltNotNull](lt-not-null.md)(value: [T](index.md)?) + +Selects documents for which this field has a value strictly lesser than [value](lt-not-null.md). + +If [value](lt-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age { ltNotNull(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + +#### See also + +| | +|--------------------------------------------------------------------| +| [FilterExpression.ltNotNull](../-filter-expression/lt-not-null.md) | +| lqNotNull | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt.md new file mode 100644 index 0000000..306ab71 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[lt](lt.md) + +# lt + +[jvm]\ +fun [lt](lt.md)(value: [T](index.md)) + +Selects documents for which this field has a value strictly lesser than [value](lt.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { lt(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + +#### See also + +| | +|----------------------------------------------------| +| [FilterExpression.lt](../-filter-expression/lt.md) | +| [PredicateExpression.ltNotNull](lt-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte-not-null.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte-not-null.md new file mode 100644 index 0000000..dced833 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte-not-null.md @@ -0,0 +1,35 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[lteNotNull](lte-not-null.md) + +# lteNotNull + +[jvm]\ +fun [lteNotNull](lte-not-null.md)(value: [T](index.md)?) + +Selects documents for which this field has a value lesser or equal to [value](lte-not-null.md). + +If [value](lte-not-null.md) is `null`, the operator is not added (all elements are matched). + +### Example + +```kotlin +class User( + val name: String, + val age: Int? +) + +collection.find { + User::age { lteNotNull(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + +#### See also + +| | +|----------------------------------------------------------------------| +| [FilterExpression.lteNotNull](../-filter-expression/lte-not-null.md) | +| [PredicateExpression.eqNotNull](eq-not-null.md) | Learn more about the 'notNull' variants | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte.md new file mode 100644 index 0000000..87f6955 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte.md @@ -0,0 +1,33 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[lte](lte.md) + +# lte + +[jvm]\ +fun [lte](lte.md)(value: [T](index.md)) + +Selects documents for which this field has a value lesser or equal to [value](lte.md). + +### Example + +```kotlin +class User( + val name: String, + val age: Int?, +) + +collection.find { + User::age { lte(18) } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + +#### See also + +| | +|------------------------------------------------------| +| [FilterExpression.lte](../-filter-expression/lte.md) | +| [PredicateExpression.lteNotNull](lte-not-null.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/ne.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/ne.md new file mode 100644 index 0000000..767f8ad --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/ne.md @@ -0,0 +1,36 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[ne](ne.md) + +# ne + +[jvm]\ +fun [ne](ne.md)(value: [T](index.md)) + +Matches documents where the value of a field does not equal the [value](ne.md). + +The result includes documents which do not contain the specified field. + +### Example + +```kotlin +class User( + val name: String?, + val age: Int, +) + +collection.find { + User::name { + ne("foo") + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/ne/) + +#### See also + +| | | +|----------------------------------------------------|------------| +| [FilterExpression.ne](../-filter-expression/ne.md) | Shorthand. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/not.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/not.md new file mode 100644 index 0000000..c8563dc --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/not.md @@ -0,0 +1,36 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.expr](../index.md)/[PredicateExpression](index.md)/[not](not.md) + +# not + +[jvm]\ +fun [not](not.md)(expression: [PredicateExpression](index.md)<[T](index.md)>.() -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)) + +Performs a logical `NOT` operation on the specified [expression](not.md) and selects the documents that *do not* match the expression. This includes the elements that do not contain the field. + +### Example + +```kotlin +class User( + val name: String, + val age: Int, +) + +collection.find { + User::age { + not { + hasType(BsonType.STRING) + } + } +} +``` + +### External resources + +- +[Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/not/) + +#### See also + +| | | +|------------------------------------------------------|------------| +| [FilterExpression.not](../-filter-expression/not.md) | Shorthand. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/index.md new file mode 100644 index 0000000..5bfaa69 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/index.md @@ -0,0 +1,10 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.expr](index.md) + +# Package-level declarations + +## Types + +| Name | Summary | +|-------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [FilterExpression](-filter-expression/index.md) | [jvm]
class [FilterExpression](-filter-expression/index.md)<[T](-filter-expression/index.md)>(codec: CodecRegistry) : [CompoundExpression](../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md)
DSL for MongoDB operators that are used as predicates in conditions. | +| [PredicateExpression](-predicate-expression/index.md) | [jvm]
class [PredicateExpression](-predicate-expression/index.md)<[T](-predicate-expression/index.md)>(codec: CodecRegistry) : [CompoundExpression](../fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md)
DSL for MongoDB operators that are used as predicates in conditions in a context where the targeted field is already specified. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/index.md new file mode 100644 index 0000000..0736517 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/index.md @@ -0,0 +1,21 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[AllPositional](index.md) + +# AllPositional + +[jvm]\ +@[LowLevelApi](../../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +data object [AllPositional](index.md) : [PathSegment](../index.md) + +Path segment for the "all positional" operator (`.$[].`). + +Official documentation: + +- +[In updates](https://www.mongodb.com/docs/manual/reference/operator/update/positional-all/) + +## Functions + +| Name | Summary | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| [toString](to-string.md) | [jvm]
open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/to-string.md new file mode 100644 index 0000000..b9bb21a --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/to-string.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[AllPositional](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/-field.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/-field.md new file mode 100644 index 0000000..7f422b2 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/-field.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Field](index.md)/[Field](-field.md) + +# Field + +[jvm]\ +constructor(name: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/index.md new file mode 100644 index 0000000..4a4cc95 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/index.md @@ -0,0 +1,30 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Field](index.md) + +# Field + +[jvm]\ +@[LowLevelApi](../../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +data class [Field](index.md)(val name: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) : [PathSegment](../index.md) + +Path segment representing the name of a field. + +This class isn't meant to be used directly by end users. Instead, see [div](../../div.md). + +## Constructors + +| | | +|--------------------|--------------------------------------------------------------------------------------------------------------| +| [Field](-field.md) | [jvm]
constructor(name: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) | + +## Properties + +| Name | Summary | +|-----------------|----------------------------------------------------------------------------------------------------------------| +| [name](name.md) | [jvm]
val [name](name.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | + +## Functions + +| Name | Summary | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| [toString](to-string.md) | [jvm]
open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/name.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/name.md new file mode 100644 index 0000000..0fe2929 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/name.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Field](index.md)/[name](name.md) + +# name + +[jvm]\ +val [name](name.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/to-string.md new file mode 100644 index 0000000..07e0620 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/to-string.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Field](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/--index--.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/--index--.md new file mode 100644 index 0000000..dbb061a --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/--index--.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Indexed](index.md)/[index](--index--.md) + +# index + +[jvm]\ +val [index](--index--.md): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/-indexed.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/-indexed.md new file mode 100644 index 0000000..ec36d2b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/-indexed.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Indexed](index.md)/[Indexed](-indexed.md) + +# Indexed + +[jvm]\ +constructor(index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/index.md new file mode 100644 index 0000000..0d505da --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/index.md @@ -0,0 +1,30 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Indexed](index.md) + +# Indexed + +[jvm]\ +@[LowLevelApi](../../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +data class [Indexed](index.md)(val index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)) : [PathSegment](../index.md) + +Path segment representing an indexed element in an array. + +This class isn't meant to be used directly by end users. Instead, see [get](../../get.md). + +## Constructors + +| | | +|------------------------|---------------------------------------------------------------------------------------------------------| +| [Indexed](-indexed.md) | [jvm]
constructor(index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)) | + +## Properties + +| Name | Summary | +|-----------------------|----------------------------------------------------------------------------------------------------------------| +| [index](--index--.md) | [jvm]
val [index](--index--.md): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | + +## Functions + +| Name | Summary | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| [toString](to-string.md) | [jvm]
open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/to-string.md new file mode 100644 index 0000000..6d0c209 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/to-string.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Indexed](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/index.md new file mode 100644 index 0000000..6ae333d --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/index.md @@ -0,0 +1,23 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Positional](index.md) + +# Positional + +[jvm]\ +@[LowLevelApi](../../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +data object [Positional](index.md) : [PathSegment](../index.md) + +Path segment for the "positional" operator (`.$.`). + +Official documentation: + +- +[In aggregations](https://www.mongodb.com/docs/manual/reference/operator/projection/positional/#mongodb-projection-proj.-) +- +[In updates](https://www.mongodb.com/docs/manual/reference/operator/update/positional/) + +## Functions + +| Name | Summary | +|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| [toString](to-string.md) | [jvm]
open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/to-string.md new file mode 100644 index 0000000..f4b946b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/to-string.md @@ -0,0 +1,6 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[PathSegment](../index.md)/[Positional](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/index.md new file mode 100644 index 0000000..0af4f10 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/index.md @@ -0,0 +1,31 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PathSegment](index.md) + +# PathSegment + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +sealed class [PathSegment](index.md) + +Single segment in a [Path](../-path/index.md). + +Each subclass represents a different type of segment that can appear in a path, and links to the high-level factory to obtain an instance of this path. + +The high-level operators are only available in correct contexts to disambiguate multiple usages of the same operator. Subclasses of this type do not protect against these usages. + +#### Inheritors + +| | +|-------------------------------------------| +| [Field](-field/index.md) | +| [Indexed](-indexed/index.md) | +| [Positional](-positional/index.md) | +| [AllPositional](-all-positional/index.md) | + +## Types + +| Name | Summary | +|-------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [AllPositional](-all-positional/index.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
data object [AllPositional](-all-positional/index.md) : [PathSegment](index.md)
Path segment for the "all positional" operator (`.$[].`). | +| [Field](-field/index.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
data class [Field](-field/index.md)(val name: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) : [PathSegment](index.md)
Path segment representing the name of a field. | +| [Indexed](-indexed/index.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
data class [Indexed](-indexed/index.md)(val index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)) : [PathSegment](index.md)
Path segment representing an indexed element in an array. | +| [Positional](-positional/index.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
data object [Positional](-positional/index.md) : [PathSegment](index.md)
Path segment for the "positional" operator (`.$.`). | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/index.md new file mode 100644 index 0000000..9c67bdb --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/index.md @@ -0,0 +1,12 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[Path](../index.md)/[Companion](index.md) + +# Companion + +[jvm]\ +object [Companion](index.md) + +## Functions + +| Name | Summary | +|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [root](root.md) | [jvm]
@[LowLevelApi](../../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [root](root.md)(segment: [PathSegment](../../-path-segment/index.md)): [Path](../index.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/root.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/root.md new file mode 100644 index 0000000..308a07a --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/root.md @@ -0,0 +1,9 @@ +//[dsl](../../../../index.md)/[fr.qsh.ktmongo.dsl.path](../../index.md)/[Path](../index.md)/[Companion](index.md)/[root](root.md) + +# root + +[jvm]\ + +@[LowLevelApi](../../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +fun [root](root.md)(segment: [PathSegment](../../-path-segment/index.md)): [Path](../index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-path.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-path.md new file mode 100644 index 0000000..73f9737 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/-path.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[Path](index.md)/[Path](-path.md) + +# Path + +[jvm]\ +constructor(segment: [PathSegment](../-path-segment/index.md), parent: [Path](index.md)?) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/as-sequence.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/as-sequence.md new file mode 100644 index 0000000..b37c15b --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/as-sequence.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[Path](index.md)/[asSequence](as-sequence.md) + +# asSequence + +[jvm]\ +fun [asSequence](as-sequence.md)(): [Sequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/index.html)<[PathSegment](../-path-segment/index.md)> diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/index.md new file mode 100644 index 0000000..062785c --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/index.md @@ -0,0 +1,48 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[Path](index.md) + +# Path + +[jvm]\ +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +data class [Path](index.md)(val segment: [PathSegment](../-path-segment/index.md), val parent: [Path](index.md)?) + +A path is a string pointer that identifies which field(s) are impacted by an operator. + +For example, the following are valid paths: + +- +`"foo"`: targets the field "foo", +- +`"foo.bar"`: targets the field "bar" which is part of the object "foo", +- +`"arr.$5.bar"`: targets the field "bar" which is part of the item with index 5 in the array "arr". + +This structure is a singly-linked list representing the entire path. Each segment is represented by [PathSegment](../-path-segment/index.md). + +## Constructors + +| | | +|------------------|----------------------------------------------------------------------------------------------------| +| [Path](-path.md) | [jvm]
constructor(segment: [PathSegment](../-path-segment/index.md), parent: [Path](index.md)?) | + +## Types + +| Name | Summary | +|----------------------------------|--------------------------------------------------| +| [Companion](-companion/index.md) | [jvm]
object [Companion](-companion/index.md) | + +## Properties + +| Name | Summary | +|-----------------------|------------------------------------------------------------------------------| +| [parent](parent.md) | [jvm]
val [parent](parent.md): [Path](index.md)? | +| [segment](segment.md) | [jvm]
val [segment](segment.md): [PathSegment](../-path-segment/index.md) | + +## Functions + +| Name | Summary | +|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [asSequence](as-sequence.md) | [jvm]
fun [asSequence](as-sequence.md)(): [Sequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/index.html)<[PathSegment](../-path-segment/index.md)> | +| [plus](../plus.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
operator fun [Path](index.md).[plus](../plus.md)(segment: [PathSegment](../-path-segment/index.md)): [Path](index.md) | +| [toString](to-string.md) | [jvm]
open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/parent.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/parent.md new file mode 100644 index 0000000..c3dc9d2 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/parent.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[Path](index.md)/[parent](parent.md) + +# parent + +[jvm]\ +val [parent](parent.md): [Path](index.md)? diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/segment.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/segment.md new file mode 100644 index 0000000..ec546a3 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/segment.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[Path](index.md)/[segment](segment.md) + +# segment + +[jvm]\ +val [segment](segment.md): [PathSegment](../-path-segment/index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/to-string.md new file mode 100644 index 0000000..2fcfcaa --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-path/to-string.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[Path](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/-property-path.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/-property-path.md new file mode 100644 index 0000000..f9afeb2 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/-property-path.md @@ -0,0 +1,15 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[PropertyPath](-property-path.md) + +# PropertyPath + +[jvm]\ +constructor(path: [Path](../-path/index.md), backingProperty: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>) + +#### Parameters + +jvm + +| | | +|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| RootParent | The type at the root of this path. Normally, [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html) instances refer to the direct parent. Instead, this class refers to the very first type in the property chain. | +| Value | The type of the property pointed to by this instance. | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/annotations.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/annotations.md new file mode 100644 index 0000000..1ac28b8 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/annotations.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[annotations](annotations.md) + +# annotations + +[jvm]\ +open override val [annotations](annotations.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[Annotation](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-annotation/index.html)> diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call-by.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call-by.md new file mode 100644 index 0000000..939c93a --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call-by.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[callBy](call-by.md) + +# callBy + +[jvm]\ +open override fun [callBy](call-by.md)(args: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[KParameter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-parameter/index.html), [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?>): [Value](index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call.md new file mode 100644 index 0000000..b8ba47d --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[call](call.md) + +# call + +[jvm]\ +open override fun [call](call.md)(vararg args: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Value](index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get-delegate.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get-delegate.md new file mode 100644 index 0000000..0c81734 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get-delegate.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[getDelegate](get-delegate.md) + +# getDelegate + +[jvm]\ +open override fun [getDelegate](get-delegate.md)(receiver: [RootParent](index.md)): [Nothing](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-nothing/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get.md new file mode 100644 index 0000000..878331d --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[get](get.md) + +# get + +[jvm]\ +open override fun [get](get.md)(receiver: [RootParent](index.md)): [Value](index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/getter.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/getter.md new file mode 100644 index 0000000..4b4e252 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/getter.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[getter](getter.md) + +# getter + +[jvm]\ +open override val [getter](getter.md): [KProperty1.Getter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/-getter/index.html)<[RootParent](index.md), [Value](index.md)> diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/index.md new file mode 100644 index 0000000..3cca6f4 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/index.md @@ -0,0 +1,60 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md) + +# PropertyPath + +@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +class [PropertyPath](index.md)<[RootParent](index.md), [Value](index.md)>(path: [Path](../-path/index.md), backingProperty: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>) : [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[RootParent](index.md), [Value](index.md)> + +Helper to construct a [Path](../-path/index.md) from Kotlin property names. + +This class is masquerading as an instance of [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html). This allows us to refer to fields directly using [property references](https://kotlinlang.org/docs/reflection.html#bound-function-and-property-references). + +Instances of this class are created using the helpers [div](../div.md). + +#### Parameters + +jvm + +| | | +|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| RootParent | The type at the root of this path. Normally, [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html) instances refer to the direct parent. Instead, this class refers to the very first type in the property chain. | +| Value | The type of the property pointed to by this instance. | + +## Constructors + +| | | +|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [PropertyPath](-property-path.md) | [jvm]
constructor(path: [Path](../-path/index.md), backingProperty: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>) | + +## Properties + +| Name | Summary | +|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [annotations](annotations.md) | [jvm]
open override val [annotations](annotations.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[Annotation](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-annotation/index.html)> | +| [getter](getter.md) | [jvm]
open override val [getter](getter.md): [KProperty1.Getter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/-getter/index.html)<[RootParent](index.md), [Value](index.md)> | +| [isAbstract](is-abstract.md) | [jvm]
open override val [isAbstract](is-abstract.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | +| [isConst](is-const.md) | [jvm]
open override val [isConst](is-const.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | +| [isFinal](is-final.md) | [jvm]
open override val [isFinal](is-final.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | +| [isLateinit](is-lateinit.md) | [jvm]
open override val [isLateinit](is-lateinit.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | +| [isOpen](is-open.md) | [jvm]
open override val [isOpen](is-open.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | +| [isSuspend](is-suspend.md) | [jvm]
open override val [isSuspend](is-suspend.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | +| [name](name.md) | [jvm]
open override val [name](name.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | +| [parameters](parameters.md) | [jvm]
open override val [parameters](parameters.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[KParameter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-parameter/index.html)> | +| [returnType](return-type.md) | [jvm]
open override val [returnType](return-type.md): [KType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-type/index.html) | +| [typeParameters](type-parameters.md) | [jvm]
open override val [typeParameters](type-parameters.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[KTypeParameter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-type-parameter/index.html)> | +| [visibility](visibility.md) | [jvm]
open override val [visibility](visibility.md): [KVisibility](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-visibility/index.html)? | + +## Functions + +| Name | Summary | +|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [call](call.md) | [jvm]
open override fun [call](call.md)(vararg args: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Value](index.md) | +| [callBy](call-by.md) | [jvm]
open override fun [callBy](call-by.md)(args: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[KParameter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-parameter/index.html), [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?>): [Value](index.md) | +| [div](../div.md) | [jvm]
operator fun <[T0](../div.md), [T1](../div.md), [T2](../div.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](../div.md), [T1](../div.md)>.[div](../div.md)(child: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T1](../div.md), [T2](../div.md)>): [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](../div.md), [T2](../div.md)>
Combines Kotlin properties into a path usable to point to a specific field in a document. | +| [get](get.md) | [jvm]
open override fun [get](get.md)(receiver: [RootParent](index.md)): [Value](index.md) | +| [get](../get.md) | [jvm]
operator fun <[T0](../get.md), [T1](../get.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](../get.md), [Collection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html)<[T1](../get.md)>>.[get](../get.md)(index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)): [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](../get.md), [T1](../get.md)>
Denotes a specific item in an array, by index. | +| [getDelegate](get-delegate.md) | [jvm]
open override fun [getDelegate](get-delegate.md)(receiver: [RootParent](index.md)): [Nothing](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-nothing/index.html) | +| [invoke](invoke.md) | [jvm]
open operator override fun [invoke](invoke.md)(p1: [RootParent](index.md)): [Value](index.md) | +| [path](../path.md) | [jvm]
@[LowLevelApi](../../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>.[path](../path.md)(): [Path](../-path/index.md) | +| [toString](to-string.md) | [jvm]
open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/invoke.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/invoke.md new file mode 100644 index 0000000..a96cb67 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/invoke.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[invoke](invoke.md) + +# invoke + +[jvm]\ +open operator override fun [invoke](invoke.md)(p1: [RootParent](index.md)): [Value](index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-abstract.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-abstract.md new file mode 100644 index 0000000..b0b030e --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-abstract.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[isAbstract](is-abstract.md) + +# isAbstract + +[jvm]\ +open override val [isAbstract](is-abstract.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-const.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-const.md new file mode 100644 index 0000000..ffc1cba --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-const.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[isConst](is-const.md) + +# isConst + +[jvm]\ +open override val [isConst](is-const.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-final.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-final.md new file mode 100644 index 0000000..4860b50 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-final.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[isFinal](is-final.md) + +# isFinal + +[jvm]\ +open override val [isFinal](is-final.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-lateinit.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-lateinit.md new file mode 100644 index 0000000..fd82664 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-lateinit.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[isLateinit](is-lateinit.md) + +# isLateinit + +[jvm]\ +open override val [isLateinit](is-lateinit.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-open.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-open.md new file mode 100644 index 0000000..b633508 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-open.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[isOpen](is-open.md) + +# isOpen + +[jvm]\ +open override val [isOpen](is-open.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-suspend.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-suspend.md new file mode 100644 index 0000000..b3bb753 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-suspend.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[isSuspend](is-suspend.md) + +# isSuspend + +[jvm]\ +open override val [isSuspend](is-suspend.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/name.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/name.md new file mode 100644 index 0000000..454e9fb --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/name.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[name](name.md) + +# name + +[jvm]\ +open override val [name](name.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/parameters.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/parameters.md new file mode 100644 index 0000000..c227bec --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/parameters.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[parameters](parameters.md) + +# parameters + +[jvm]\ +open override val [parameters](parameters.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[KParameter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-parameter/index.html)> diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/return-type.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/return-type.md new file mode 100644 index 0000000..aa53a7a --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/return-type.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[returnType](return-type.md) + +# returnType + +[jvm]\ +open override val [returnType](return-type.md): [KType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-type/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/to-string.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/to-string.md new file mode 100644 index 0000000..848dc02 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/to-string.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[toString](to-string.md) + +# toString + +[jvm]\ +open override fun [toString](to-string.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/type-parameters.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/type-parameters.md new file mode 100644 index 0000000..bf1eb6d --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/type-parameters.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[typeParameters](type-parameters.md) + +# typeParameters + +[jvm]\ +open override val [typeParameters](type-parameters.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[KTypeParameter](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-type-parameter/index.html)> diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/visibility.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/visibility.md new file mode 100644 index 0000000..5fafc59 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/-property-path/visibility.md @@ -0,0 +1,6 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl.path](../index.md)/[PropertyPath](index.md)/[visibility](visibility.md) + +# visibility + +[jvm]\ +open override val [visibility](visibility.md): [KVisibility](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-visibility/index.html)? diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/div.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/div.md new file mode 100644 index 0000000..bb19326 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/div.md @@ -0,0 +1,40 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.path](index.md)/[div](div.md) + +# div + +[jvm]\ +operator fun <[T0](div.md), [T1](div.md), [T2](div.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](div.md), [T1](div.md)>.[div](div.md)(child: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T1](div.md), [T2](div.md)>): [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](div.md), [T2](div.md)> + +Combines Kotlin properties into a path usable to point to a specific field in a document. + +### Examples + +```kotlin +class User( + val id: Int, + val profile: Profile, +) + +class Profile( + val name: String, + val age: Int, +) + +// Refer to the id +println(User::id) +// → 'id' + +// Refer to the name +println(User::profile / Profile::name) +// → 'profile.name' + +// Refer to the name +println(User::profile / Profile::age) +// → 'profile.age' +``` + +#### See also + +| | | +|---------------|-------------------------| +| [get](get.md) | Indexed access (`.$0.`) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/get.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/get.md new file mode 100644 index 0000000..47b4281 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/get.md @@ -0,0 +1,35 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.path](index.md)/[get](get.md) + +# get + +[jvm]\ +operator fun <[T0](get.md), [T1](get.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](get.md), [Collection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html)<[T1](get.md)>>.[get](get.md)(index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)): [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](get.md), [T1](get.md)> + +Denotes a specific item in an array, by index. + +### Examples + +```kotlin +class User( + val name: String, + val friends: List, +) + +class Friend( + val name: String, +) + +// Refer to the first friend +println(User::friends[0]) +// → 'friends.$0' + +// Refer to the third friend's name +println(User::friends[2] / Friend::name) +// → 'friends.$0.name' +``` + +#### See also + +| | | +|---------------|------------------------------------------| +| [div](div.md) | Access based on the field name (`.foo.`) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/index.md new file mode 100644 index 0000000..f109c62 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/index.md @@ -0,0 +1,20 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.path](index.md) + +# Package-level declarations + +## Types + +| Name | Summary | +|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Path](-path/index.md) | [jvm]
@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
data class [Path](-path/index.md)(val segment: [PathSegment](-path-segment/index.md), val parent: [Path](-path/index.md)?)
A path is a string pointer that identifies which field(s) are impacted by an operator. | +| [PathSegment](-path-segment/index.md) | [jvm]
@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
sealed class [PathSegment](-path-segment/index.md)
Single segment in a [Path](-path/index.md). | +| [PropertyPath](-property-path/index.md) | [jvm]
@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
class [PropertyPath](-property-path/index.md)<[RootParent](-property-path/index.md), [Value](-property-path/index.md)>(path: [Path](-path/index.md), backingProperty: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>) : [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[RootParent](-property-path/index.md), [Value](-property-path/index.md)>
Helper to construct a [Path](-path/index.md) from Kotlin property names. | + +## Functions + +| Name | Summary | +|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [div](div.md) | [jvm]
operator fun <[T0](div.md), [T1](div.md), [T2](div.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](div.md), [T1](div.md)>.[div](div.md)(child: [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T1](div.md), [T2](div.md)>): [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](div.md), [T2](div.md)>
Combines Kotlin properties into a path usable to point to a specific field in a document. | +| [get](get.md) | [jvm]
operator fun <[T0](get.md), [T1](get.md)> [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](get.md), [Collection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html)<[T1](get.md)>>.[get](get.md)(index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)): [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<[T0](get.md), [T1](get.md)>
Denotes a specific item in an array, by index. | +| [path](path.md) | [jvm]
@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>.[path](path.md)(): [Path](-path/index.md) | +| [plus](plus.md) | [jvm]
@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md)
operator fun [Path](-path/index.md).[plus](plus.md)(segment: [PathSegment](-path-segment/index.md)): [Path](-path/index.md) | diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/path.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/path.md new file mode 100644 index 0000000..b560301 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/path.md @@ -0,0 +1,9 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.path](index.md)/[path](path.md) + +# path + +[jvm]\ + +@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +fun [KProperty1](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html)<*, *>.[path](path.md)(): [Path](-path/index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/plus.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/plus.md new file mode 100644 index 0000000..4256bb7 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl.path/plus.md @@ -0,0 +1,9 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl.path](index.md)/[plus](plus.md) + +# plus + +[jvm]\ + +@[LowLevelApi](../fr.qsh.ktmongo.dsl/-low-level-api/index.md) + +operator fun [Path](-path/index.md).[plus](plus.md)(segment: [PathSegment](-path-segment/index.md)): [Path](-path/index.md) diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md new file mode 100644 index 0000000..e886857 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md @@ -0,0 +1,10 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl](../index.md)/[KtMongoDsl](index.md) + +# KtMongoDsl + +[jvm]\ +@[DslMarker](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-dsl-marker/index.html) + +annotation class [KtMongoDsl](index.md) + +Marker for functions that are part of the KtMongo DSL. diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-low-level-api/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-low-level-api/index.md new file mode 100644 index 0000000..aebc664 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/-low-level-api/index.md @@ -0,0 +1,12 @@ +//[dsl](../../../index.md)/[fr.qsh.ktmongo.dsl](../index.md)/[LowLevelApi](index.md) + +# LowLevelApi + +[jvm]\ +annotation class [LowLevelApi](index.md) + +Annotation to mark parts of the library that are not meant to be used by end-users. + +They are still public because they may be needed by driver implementations, or to in case some functionality is missing in the high-level API (which is everything *not* annotated by this annotation). + +Users should be cautious about using functionality from the low-level API, as it may not protect against incorrect usage. This could leak to injection attacks, memory leaks, or other unwanted consequences. diff --git a/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/index.md b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/index.md new file mode 100644 index 0000000..d983dc6 --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/fr.qsh.ktmongo.dsl/index.md @@ -0,0 +1,10 @@ +//[dsl](../../index.md)/[fr.qsh.ktmongo.dsl](index.md) + +# Package-level declarations + +## Types + +| Name | Summary | +|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [KtMongoDsl](-kt-mongo-dsl/index.md) | [jvm]
@[DslMarker](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-dsl-marker/index.html)
annotation class [KtMongoDsl](-kt-mongo-dsl/index.md)
Marker for functions that are part of the KtMongo DSL. | +| [LowLevelApi](-low-level-api/index.md) | [jvm]
annotation class [LowLevelApi](-low-level-api/index.md)
Annotation to mark parts of the library that are not meant to be used by end-users. | diff --git a/docs/website/docs/reference-dsl/dsl/package-list b/docs/website/docs/reference-dsl/dsl/package-list new file mode 100644 index 0000000..15e88da --- /dev/null +++ b/docs/website/docs/reference-dsl/dsl/package-list @@ -0,0 +1,123 @@ +$dokka.format:gfm-v1 +$dokka.linkExtension:md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common////PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common//acceptAll/fr.qsh.ktmongo.dsl.expr.common.CompoundExpression#kotlin.collections.Iterable[fr.qsh.ktmongo.dsl.expr.common.Expression]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/accept-all.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common//withLoggedContext/org.bson.BsonWriter#kotlin.Boolean/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/with-logged-context.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/CompoundExpression.Companion///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-companion/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/CompoundExpression///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/CompoundExpression/CompoundExpression/#org.bson.codecs.configuration.CodecRegistry/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/-compound-expression.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/CompoundExpression/accept/#fr.qsh.ktmongo.dsl.expr.common.Expression/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/accept.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/CompoundExpression/simplify/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-compound-expression/simplify.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression.Companion///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-companion/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression/Expression/#org.bson.codecs.configuration.CodecRegistry/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/-expression.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression/freeze/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/freeze.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression/simplify/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/simplify.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression/toString/#kotlin.Boolean/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.expr.common/Expression/writeTo/#org.bson.BsonWriter/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr.common/-expression/write-to.md +$dokka.location:fr.qsh.ktmongo.dsl.expr////PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/FilterExpression/#org.bson.codecs.configuration.CodecRegistry/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/-filter-expression.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/and/#kotlin.Function1[fr.qsh.ktmongo.dsl.expr.FilterExpression[TypeParam(bounds=[kotlin.Any?])],kotlin.Unit]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/and.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/doesNotExist/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/does-not-exist.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/eq/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/eqNotNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/exists/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/exists.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/gt/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/gtNotNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/gte/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/gteNotNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/hasType/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#org.bson.BsonType/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/has-type.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/invoke/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#kotlin.Function1[fr.qsh.ktmongo.dsl.expr.PredicateExpression[TypeParam(bounds=[kotlin.Any?])],kotlin.Unit]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/invoke.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/isNotNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/isNotUndefined/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-undefined.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/isNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/isOneOf/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#kotlin.Array[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/isOneOf/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#kotlin.collections.List[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/isUndefined/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-undefined.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/lt/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/ltNotNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/lte/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/lteNotNull/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/ne/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/ne.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/not/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#kotlin.Function1[fr.qsh.ktmongo.dsl.expr.PredicateExpression[TypeParam(bounds=[kotlin.Any?])],kotlin.Unit]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/not.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/FilterExpression/or/#kotlin.Function1[fr.qsh.ktmongo.dsl.expr.FilterExpression[TypeParam(bounds=[kotlin.Any?])],kotlin.Unit]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/or.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/index.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/PredicateExpression/#org.bson.codecs.configuration.CodecRegistry/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/-predicate-expression.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/doesNotExist/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/does-not-exist.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/eq/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/eqNotNull/#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/eq-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/exists/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/exists.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/gt/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/gtNotNull/#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gt-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/gte/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/gteNotNull/#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/gte-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/hasType/#org.bson.BsonType/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/has-type.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/isNotNull/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/isNotUndefined/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-not-undefined.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/isNull/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/isOneOf/#kotlin.Array[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-one-of.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/isOneOf/#kotlin.collections.List[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-one-of.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/isUndefined/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/is-undefined.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/lt/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/ltNotNull/#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lt-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/lte/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/lteNotNull/#TypeParam(bounds=[kotlin.Any?])?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/lte-not-null.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/ne/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/ne.md +$dokka.location:fr.qsh.ktmongo.dsl.expr/PredicateExpression/not/#kotlin.Function1[fr.qsh.ktmongo.dsl.expr.PredicateExpression[TypeParam(bounds=[kotlin.Any?])],kotlin.Unit]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.expr/-predicate-expression/not.md +$dokka.location:fr.qsh.ktmongo.dsl.path////PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path//div/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]#kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/div.md +$dokka.location:fr.qsh.ktmongo.dsl.path//get/kotlin.reflect.KProperty1[TypeParam(bounds=[kotlin.Any?]),kotlin.collections.Collection[TypeParam(bounds=[kotlin.Any?])]]#kotlin.Int/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/get.md +$dokka.location:fr.qsh.ktmongo.dsl.path//path/kotlin.reflect.KProperty1[*,*]#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/path.md +$dokka.location:fr.qsh.ktmongo.dsl.path//plus/fr.qsh.ktmongo.dsl.path.Path#fr.qsh.ktmongo.dsl.path.PathSegment/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/plus.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path.Companion///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path.Companion/root/#fr.qsh.ktmongo.dsl.path.PathSegment/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/-companion/root.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path/Path/#fr.qsh.ktmongo.dsl.path.PathSegment#fr.qsh.ktmongo.dsl.path.Path?/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/-path.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path/asSequence/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/as-sequence.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path/parent/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/parent.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path/segment/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/segment.md +$dokka.location:fr.qsh.ktmongo.dsl.path/Path/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.AllPositional///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.AllPositional/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-all-positional/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Field///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Field/Field/#kotlin.String/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/-field.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Field/name/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/name.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Field/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-field/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Indexed///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Indexed/Indexed/#kotlin.Int/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/-indexed.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Indexed/index/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/--index--.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Indexed/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-indexed/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Positional///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment.Positional/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/-positional/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PathSegment///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-path-segment/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/index.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/PropertyPath/#fr.qsh.ktmongo.dsl.path.Path#kotlin.reflect.KProperty1[*,*]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/-property-path.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/annotations/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/annotations.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/call/#kotlin.Array[kotlin.Any?]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/callBy/#kotlin.collections.Map[kotlin.reflect.KParameter,kotlin.Any?]/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/call-by.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/get/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/getDelegate/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/get-delegate.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/getter/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/getter.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/invoke/#TypeParam(bounds=[kotlin.Any?])/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/invoke.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/isAbstract/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-abstract.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/isConst/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-const.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/isFinal/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-final.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/isLateinit/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-lateinit.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/isOpen/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-open.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/isSuspend/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/is-suspend.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/name/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/name.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/parameters/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/parameters.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/returnType/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/return-type.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/toString/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/to-string.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/typeParameters/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/type-parameters.md +$dokka.location:fr.qsh.ktmongo.dsl.path/PropertyPath/visibility/#/PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl.path/-property-path/visibility.md +$dokka.location:fr.qsh.ktmongo.dsl////PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl/index.md +$dokka.location:fr.qsh.ktmongo.dsl/KtMongoDsl///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md +$dokka.location:fr.qsh.ktmongo.dsl/LowLevelApi///PointingToDeclaration/dsl/fr.qsh.ktmongo.dsl/-low-level-api/index.md +fr.qsh.ktmongo.dsl +fr.qsh.ktmongo.dsl.expr +fr.qsh.ktmongo.dsl.expr.common +fr.qsh.ktmongo.dsl.path + diff --git a/docs/website/docs/reference-dsl/index.md b/docs/website/docs/reference-dsl/index.md new file mode 100644 index 0000000..c9d2c43 --- /dev/null +++ b/docs/website/docs/reference-dsl/index.md @@ -0,0 +1,12 @@ +//[dsl](index.md) + +# dsl + +## Packages + +| Name | +|-------------------------------------------------------------------------------| +| [fr.qsh.ktmongo.dsl](dsl/fr.qsh.ktmongo.dsl/index.md) | +| [fr.qsh.ktmongo.dsl.expr](dsl/fr.qsh.ktmongo.dsl.expr/index.md) | +| [fr.qsh.ktmongo.dsl.expr.common](dsl/fr.qsh.ktmongo.dsl.expr.common/index.md) | +| [fr.qsh.ktmongo.dsl.path](dsl/fr.qsh.ktmongo.dsl.path/index.md) | diff --git a/docs/website/mkdocs.yml b/docs/website/mkdocs.yml index 023aa00..ba60ac1 100644 --- a/docs/website/mkdocs.yml +++ b/docs/website/mkdocs.yml @@ -93,3 +93,42 @@ nav: - migrate-from-kmongo/setup.md - migrate-from-kmongo/search.md - migrate-from-kmongo/nested-fields.md + + - Reference: + - DSL: + - reference-dsl/index.md + - fr.qsh.ktmongo.dsl: + - reference-dsl/dsl/fr.qsh.ktmongo.dsl/index.md + - KtMongoDsl: reference-dsl/dsl/fr.qsh.ktmongo.dsl/-kt-mongo-dsl/index.md + - LowLevelApi: reference-dsl/dsl/fr.qsh.ktmongo.dsl/-low-level-api/index.md + - fr.qsh.ktmongo.dsl.expr: + - reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/index.md + - FilterExpression: + - reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/index.md + - accept: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/accept.md + - acceptAll: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/accept-all.md + - and: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/and.md + - doesNotExist: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/does-not-exist.md + - eq: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq.md + - eqNotNull: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/eq-not-null.md + - exists: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/exists.md + - freeze: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/freeze.md + - gt: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt.md + - gte: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte.md + - gteNotNull: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gte-not-null.md + - gtNotNull: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/gt-not-null.md + - hasType: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/has-type.md + - invoke: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/invoke.md + - isNotNull: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-null.md + - isNotUndefined: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-not-undefined.md + - isNull: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-null.md + - isOneOf: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-one-of.md + - isUndefined: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/is-undefined.md + - lt: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lt.md + - lte: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte.md + - lteNotNull: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/lte-not-null.md + - ne: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/ne.md + - not: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/not.md + - or: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/or.md + - simplify: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/simplify.md + - writeTo: reference-dsl/dsl/fr.qsh.ktmongo.dsl.expr/-filter-expression/writeTo.md