MongoDB and employees & departments
MongoDB and employees & departments I know that lot of you made their first Oracle steps with the emp/dept repository. And lot of DBA/developers came back often to these examples to test more complex queries. Even if you never played with Oracle emp/dept examples, I keep these examples enough simple. (Anyway, you can find here the exemples to play with: https://jastrebicdragutin.wordpress.com/2020/12/16/emp-and-dept-table-queries/ ) So let’s make the same steps with MongoDB and JSON documents. Since MongoDB does not anything about schemas, it will implicitly create one when you ask it to use it. use scott Mongo has its collections, which corresponds to RDBMS tables, and its documents, which are rows. All rows does not need to have the same structure in the JSON document, we will see it later. And you don’t need to explicitly create a collection, it will be implicitly created when you insert a first document in it. db.emp.insert({empno:1,ename: “Bob”, sal: 100000}) ...