Skip to content

Commit d7d2771

Browse files
committed
docs(nitrite): refresh query support boundaries
Update the Nitrite guide to match the current TCK-backed repository and criteria support. Document common Jakarta Data query semantics, sort/page/limit precedence, LIKE and regex support, property comparisons, logical predicates, and runtime-evaluated computed expressions. Remove stale limitations that listed lower and upper as unsupported now that those expressions are handled. Replace the stale Jackson mapper section with the current object-mapping contract: Nitrite uses Micronaut Data mapping over Nitrite collections, does not require Nitrite's Jackson mapper module, and treats a Micronaut Serde ObjectMapper as optional.
1 parent f676afb commit d7d2771

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

src/main/docs/guide/nitrite.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ It supports common Micronaut Data repository patterns, including:
77
- <<nitriteMapping, Entity Mapping>>
88
- <<nitriteAssociationFetching, Association Fetching>>
99
- <<nitriteCriteriaSpecifications, Criteria API>>
10+
- Jakarta Data repository query semantics for common document queries
1011
- <<nitriteTransactions, Transactions>> (via Micronaut Data TX infrastructure)
1112
- <<nitriteSpatial, Spatial Queries>>
1213
13-
Nitrite is intended for practical embedded use-cases that need Micronaut Data repositories without running an external datastore. It supports the core repository, mapping, association, criteria, transaction, optimistic locking, and optional spatial features described in this chapter. It is not a feature-equivalent MongoDB replacement; see <<nitriteLimitations>>.
14+
Nitrite is intended for practical embedded use-cases that need Micronaut Data repositories without running an external datastore. It supports the core repository, mapping, association, criteria, projection, sorting, pagination, transaction, optimistic locking, and optional spatial features described in this chapter. It is not a feature-equivalent MongoDB replacement; see <<nitriteLimitations>>.

src/main/docs/guide/nitrite/nitriteConfiguration.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ The spatial module enables:
6464

6565
See <<nitriteSpatial>> for detailed usage. See the https://nitrite.dizitart.com/java-sdk/modules/spatial/index.html[Nitrite Spatial Module documentation] and https://nitrite.dizitart.com/java-sdk/filter/index.html#spatial-filters[Spatial Filters documentation] for more details.
6666

67-
=== Jackson Mapper
67+
=== Object Mapping
6868

69-
The Jackson mapper is included by default and provides JSON serialization support. No additional configuration is required.
70-
71-
See the https://nitrite.dizitart.com/java-sdk/modules/jackson/index.html#jackson-mapper[Nitrite Jackson Mapper documentation] for more details.
69+
Micronaut Data Nitrite uses its own Micronaut Data mapping layer with Nitrite collections. It does not require Nitrite's Jackson mapper module, and a Micronaut Serde `ObjectMapper` bean is optional. If Micronaut Serde is present, the mapper can use it for non-simple nested values; otherwise it relies on Micronaut introspection and the built-in conversion service.
7270

7371
== Batch Operations
7472

src/main/docs/guide/nitrite/nitriteCriteriaSpecifications/nitriteCriteriaExecuteQuery.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ The `findAll(Specification, Pageable)` method returns a `Page<T>` with paginatio
2525

2626
snippet::example.PersonRepositoryExample[project-base="doc-examples/nitrite-example", source="main", tags="sorting-pagination-usage"]
2727

28+
Method-name `OrderBy` clauses, dynamic `Sort`, `Pageable` sorting, `Limit`, and offset pagination are supported for repository and criteria queries. When both a static method sort and a dynamic sort are present, Micronaut Data's standard ordering precedence is preserved.
29+
30+
== Predicate and Expression Support
31+
32+
Nitrite supports the common Micronaut Data and Jakarta Data predicate set for document repositories, including:
33+
34+
* equality and inequality
35+
* comparison operators (`greaterThan`, `greaterThanOrEqualTo`, `lessThan`, `lessThanOrEqualTo`)
36+
* `between`
37+
* `in` and `not in`, including empty collections
38+
* `isNull`, `isNotNull`, `isTrue`, `isFalse`, empty and not-empty string checks
39+
* nested `and`, `or`, and `not` predicates
40+
* property-to-property comparisons
41+
* `like`, `not like`, case-insensitive like, regex predicates, and custom LIKE escape characters
42+
* string and computed expressions including `length`, `lower`, `upper`, `concat`, `right`, and multiplication (`prod`)
43+
44+
Computed expression predicates are evaluated by the Nitrite runtime against candidate documents when Nitrite has no equivalent native indexed operator. They are useful for repository correctness and Jakarta Data compatibility, but they should not be treated as indexed predicates for large collections.
45+
2846
== Association Queries
2947

3048
Nitrite supports Criteria queries on associations:

src/main/docs/guide/nitrite/nitriteLimitations.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It is still a Nitrite-backed embedded store, not a MongoDB compatibility layer.
1515
Micronaut Data Nitrite supports the following features for embedded document storage:
1616

1717
* <<nitriteRepositories, Repository patterns>> with derived query methods
18-
* <<nitriteCriteriaSpecifications, Criteria API>> with sorting and pagination
18+
* <<nitriteCriteriaSpecifications, Criteria API>> with sorting, pagination, projection, logical predicates, LIKE/regex matching, and common computed expressions
1919
* <<nitriteAssociationMapping, Association mapping>> with cascade operations
2020
* <<nitriteAssociationFetching, Association fetching>> with `@Join` annotation
2121
* <<nitriteOptimisticLocking, Optimistic locking>> with `@Version` annotation
@@ -30,6 +30,7 @@ For details and examples, see the respective sections above.
3030
The following boundaries remain:
3131

3232
* `@Join` uses Nitrite's default fetch behavior; custom join types such as `LEFT_FETCH` and `INNER_FETCH` are not currently distinguished.
33-
* Criteria subqueries (`cb.exists(subquery)`), arithmetic transforms such as `sum` and `diff`, and string transforms such as `lower` and `upper` are not supported. These are shared limitations across the Micronaut Data document-family criteria implementation (Mongo included), not something specific to Nitrite. String-length (`cb.length(...)`) and multiplication (`cb.prod(...)`) expressions *are* supported in Nitrite, but evaluated in application code against each candidate document rather than pushed down (Nitrite has no `$strLenCP`/`$multiply` equivalent), so they are unindexed and scan the collection.
33+
* Criteria subqueries (`cb.exists(subquery)`) are not supported by Nitrite.
34+
* Criteria `sum`, `diff`, and unsupported string transforms such as `trim` are rejected. Supported computed expressions such as `length`, `lower`, `upper`, `concat`, `right`, and `prod` are evaluated in application code against candidate documents rather than pushed down to Nitrite indexes, so use them with care on large collections.
3435
* Advanced Mongo-style aggregation pipelines are out of scope. Use repository aggregate methods, including property-scoped distinct counts, and Criteria API support where applicable.
3536
* Embedded/nested POJO values are persisted and round-trip correctly, but derived nested-property queries against arbitrary embedded object fields depend on annotation processor support.

0 commit comments

Comments
 (0)