jqCouch

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-09 10:58:37

软件介绍

jQuery plugin for CouchDB, handling different type of couchdb connections.

jqcouch requires the new JSON-based CouchDB, which currently has to be installed from svn.
More details on this in the CouchDB projects website.

Database

var dbc = $.jqCouch.connection('db');
dbc.exists('database_name');

---
if ($.jqCouch.connection('db').create('database_name').ok) {
    alert("database created");
}


Doc

var dc = $.jqCouch.connection('doc');
var rev = dc.get('database/document1')._rev;

---
var doc = {_id:"0",a:1,b:1};
if ($.jqCouch.connection('doc').save('database_name', doc)._id !== false) {
    alert("Created document with rev: "+doc._rev+", a="+doc.a);
}

---
//Get all documents from database. (With cache)
var dc = $.jqCouch.connection('doc');
dc.update_config('cache', true);
if (var total_documents = dc.all('database_name').total_rows) {
    var all_documents = dc.all('database_name').rows;   
}
//Get all documents from database. (Without cache)
var dc = $.jqCouch.connection('doc');
var all = dc.all('database_name');
if (all.total_rows > 0) {
    var all_documents = all.rows;   
}


View

var vc = $.jqCouch.connection('view');
if (vc.exists('database_name', 'event') !== false) {
    alert("View "event" exists");
}

---
if ($.jqCouch.connection('view').exists('database_name', 'event/all') !== false) {
    alert("View "event/all" exists");
}


本文地址:https://codercto.com/soft/d/22992.html

Looking For a Challenge

Looking For a Challenge

the University of Warsaw / the University of Warsaw / 2012-11 / 0

LOOKING FOR PROGRAMMING CHALLENGES? Then this book is for you! Whether it's the feeling of great satisfaction from solving a complex problem set, or the frustration of being unable to solve a task,......一起来看看 《Looking For a Challenge》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具