Skip to content

Commit ed31c53

Browse files
Merge pull request #2006 from oracle-devrel/witold-swierzy-patch-11
Witold swierzy patch 11
2 parents f94cebe + 087607c commit ed31c53

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Oracle Database 23ai support for JSON Duality and Collection Views
2+
3+
This repository contains scripts demonstrating support for Oracle JSON views in Oracle Database 23ai and Oracle API for MongoDB
4+
5+
6+
## Requirements
7+
- mongosh installed
8+
- SQL Cl installed
9+
- Oracle Database 23ai with Oracle API for MongoDB enabled
10+
- HR database sample schema installed
11+
12+
## License
13+
14+
Copyright (c) 2025 Oracle and/or its affiliates.
15+
16+
Licensed under the Universal Permissive License (UPL), Version 1.0.
17+
18+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
19+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
show collections
2+
3+
db.deptview.find()
4+
db.deptview.insertOne({_id:'991',dname:'human resources',location:1700})
5+
6+
db.empview.find()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
select *
2+
from user_json_collections;
3+
4+
soda list
5+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
drop view empview;
2+
drop view deptview;
3+
drop table departments cascade constraints;
4+
drop table employees cascade constraints;
5+
6+
create table departments
7+
as
8+
select *
9+
from hr.departments;
10+
11+
create table employees
12+
as
13+
select *
14+
from hr.employees;
15+
16+
alter table departments add primary key(department_id);
17+
alter table employees add primary key(employee_id);
18+
19+
create or replace json collection view empview
20+
as
21+
select json{'_id' : employee_id,
22+
last_name,
23+
hire_date,
24+
salary}
25+
from employees;
26+
27+
select *
28+
from user_json_collections;
29+
30+
create or replace json relational duality view deptview as
31+
select json {'_id' : department_id,
32+
'dname' : department_name,
33+
'location' : location_id}
34+
from departments with insert update delete;
35+

0 commit comments

Comments
 (0)