This sample demonstrates using the MongoDB Java driver with Oracle AI Database JSON Relational Duality Views exposed through Oracle REST Data Services (ORDS). The test creates a small relational project-tracking schema, exposes it as the `PROJECTS_DV` duality view, and then performs document operations against that view through the MongoDB API.
What this sample demonstrates
JSON
Document-shaped data and SQL/JSON querying inside Oracle AI Database.
Use when records need flexible structure without leaving SQL, indexes, constraints, and transactions.
Duality Views
Document-shaped access over relational tables using JSON Relational Duality Views.
Use when APIs need JSON documents without giving up relational storage, SQL, constraints, and transactions.
ORDS
Oracle REST Data Services samples for exposing database-backed APIs.
Use when clients need REST, MongoDB-compatible, or service-style access without owning low-level SQL.
Testcontainers
Disposable Oracle AI Database Free containers for repeatable local and integration tests.
Use when tests need real database behavior without sharing a long-lived development instance.
Highlights
- Start Oracle AI Database Free and ORDS together with Testcontainers.
- Create relational tables and a JSON Relational Duality View before ORDS starts.
- Connect with the MongoDB Java driver using the ORDS MongoDB API port.
- Insert, query, update, and delete duality-view documents through the MongoDB API.