Chinese Documentation : Discovering models from relational databases

Overview

LoopBack makes it simple to create models from an existing relational database.  This process is called discovery and is supported by the following connectors:

For NoSQL databases such as MongoDB, use instance introspection instead.

Data sources connected to relational databases automatically get the asychronous Database discovery API.  

Icon

The StrongLoop Arc graphical tool enables you to perform discovery without coding. See StrongLoop Arc for more information.

Example discovery

For example, consider an Oracle database. First, the code sets up the Oracle data source. Then the call to discoverAndBuildModels() creates models from the database tables. Calling it with the associations: true option makes the discovery follow primary/foreign key relations.