日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

ApiCloud链接云端数据库

發布時間:2023/12/20 数据库 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ApiCloud链接云端数据库 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

apicloud的mcm模塊其實就是應用云端數據庫完成一系列操作,說到云端數據,當然要先創建數據庫,按照如下方式創建,當然,雙擊就可添加數據



之后就簡單了,在項目的頁面里寫上這樣的查詢就ok了,其中appid,appkey都是來自appcloud官網數據

  • function test2() {
  • var userId = 'userId';
  • var friendUserId = 'friendUserId';
  • var model = api.require('model');
  • var query = api.require('query');
  • model.config({
  • appId : 'A6903547912689',
  • appKey : '8C6CB9D1-FD18-6B0A-859C-EA0D1A2F3927',
  • host : 'https://d.apicloud.com'
  • });
  • query.createQuery(function(ret, err) {
  • if (ret && ret.qid) {
  • //console.log(ret.qid);
  • query.whereEqual({
  • qid : ret.qid,
  • column : 'userId',
  • value : userId
  • });
  • query.whereEqual({
  • qid : ret.qid,
  • column : 'friendUserId',
  • value : friendUserId
  • });
  • model.findAll({
  • class : 'friend',
  • qid : ret.qid
  • }, function(ret, err) {
  • //coding...
  • console.log("ret=" + JSON.stringify(ret));
  • console.log("err=" + JSON.stringify(err));
  • });
  • }
  • });
  • }

  • mcm模塊包含了model、user、relation和query等對象

    完成!

    apiready = function () { var model = api.require( 'model' ); var query = api.require( 'query' ); model.config({ appid : 'A6911833617674' , appKey : '08DDA53D-8553-76B0-DA8D-3991430F1512' , host : 'https://d.apicloud.com' }); query.createQuery({ }, function(ret, err) { //coding... if (ret && ret.qid) { model.findAll({ class : 'ware' , qid : ret.qid }, function(ret, err) { //coding... var abcd = $api.byId( 'sectionmy' ); //獲取到需要填充的div for ( var i = 0 ; i < ret.length; i++) { $api.append(abcd, "<div>" +ret[i].description+ "</div>" ); } }); } }); }

    總結

    以上是生活随笔為你收集整理的ApiCloud链接云端数据库的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。