中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Couchbase View

發布時間:2020-08-14 00:01:15 來源:網絡 閱讀:897 作者:zhanjia 欄目:關系型數據庫

Couchbase index: called view -- virtually another document build via map-reduce function

  • Map function:
       Call emit() to generate a key-value pair

  • Reduce function:
       Optional (disabled by reduce=false)
       Used to calculate count, sum etc

 

Query View:

  • Call ViewResult.success() to check whether view execution is successful. Call ViewResult.error()  to see error details

  • Set ViewQuery.debug(true) generate statistics information. Retrieved by  ViewResult.debug()

  • Remember to call ViewQuery.development(true) if a development View has not been published as production view

  • For dev mode, full design doc name is:    _design/dev_[designdoc name],  to query it, just use designdoc name
       If you specify  designdoc name as dev_xxx, you get error:
       com.couchbase.client.java.error.ViewDoesNotExistException: View does not exist
       If you specify designdoc name as  /dev_xxx or  _design/dev_xxx, you get error:
       {"error":"bad_request","reason":"p_w_uploads not supported in Couchbase"}

  • To query composite key, do not use ViewQuery.key(String),  which causes additional quote to be added to the key, add get a json format error:
        invalid UTF-8 JSON  {error,garbage_after_value}
    Uses ViewQuery.key(JsonArray) and JsonArray.from(Object[] array). Each element of array must of correct type (String or Long)

  • To view complete query as url parameter after encoding:  use ViewQuery.toString()

  • Suppose a view composes of 3 field [a, b, c],   it is possible to find documents by  [a, b] only and [a, c] only using that view.  ViewQuery.startKey([a, b, null])  and ViewQuery.startKey([a, null, c])

  • Sort query result:  ViewQuery.desc()

  • References:
    http://docs.couchbase.com/admin/admin/Views/views-writing.html
    http://docs.couchbase.com/admin/admin/Views/views-querySample.html

 

Bulk operations:

  • Couchbase java sdk supports bulk operation, which improves performance for read/write for a number of documents

  • References:
    http://docs.couchbase.com/developer/java-2.1/documents-bulk.html

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

宁津县| 丹阳市| 彩票| 黔南| 辽阳县| 固阳县| 顺平县| 北京市| 修文县| 山东省| 龙井市| 馆陶县| 汶川县| 长泰县| 志丹县| 株洲市| 洛川县| 大连市| 铜梁县| 红桥区| 兰考县| 梅州市| 开阳县| 涪陵区| 大竹县| 海口市| 岳阳县| 吴川市| 东阿县| 海宁市| 武清区| 香格里拉县| 稻城县| 新泰市| 河东区| 中江县| 临沂市| 青铜峡市| 余庆县| 上犹县| 冀州市|