Skip to content

Latest commit

 

History

History

clouddb

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Cloud DB JS SDK Demo

Introduction

This project is a quick start sample developed using Cloud DB JS SDK.

Quick Start

  • On the AppGallery Connect page, create a project and add an application.

  • Click Auth Service on the navigation bar and enable authentication using an anonymous account.

  • Click Cloud DB on the navigation bar and enable database service. Then, perform the following operations:

    (1)Create a schema by importing a template file stored in BookInfo.json in the config/ directory of the project. Alternatively, create a object type named BookInfo and ensure that all fields must be the same as those in module/BookInfo.js of the project.

    (2) Create a Cloud DB zone. On the Cloud DB Zone tab page, click Add to create a Cloud DB zone named QuickStartDemo.

  • On the Project Setting page, obtain the app configuration information. Save it to the context object in the config/agconnect-services.json file.

  • Integrate the Cloud DB SDK.

    Run the following command to install the Cloud DB JavaScript SDK service module in the root directory:

      npm install
    

Operate Data

1. Login anonymous.

Login Login

2. Input zone name QuickStartDemo and click the enter button to open Cloud DB zone.

OpenZone OpenZone

3. Insert a record.

Insert Insert

4. Update a record.

Update Update

5. Delete a record.

Delete

6. Query records.

Query