How much storage do you require when using CouchDB when compared to RDBMS?

I need to know the factoring that needs to be taken into consideration when implementing a solution using CouchDB. I understand that CouchDB does not require normalization and that the standard techniques that I use in RDBMS development are mostly thrown away. But what exactly are the costs involved. I perfectly understand the benefits, but the costs of storage make me a bit nervous as it appears as CouchDB would need an awful lot of replicated data, some of it going stale and out of date well

PHP Framework with CouchDB support

I'm looking for a PHP framework that supports CouchDB pretty well natively, I understand from here that Ruby-on-rails or Django would work best, but I am looking for a PHP solution, as I'd like to not have to learn a new language just yet. features needed outside of CouchDB are minimal: MVC architecture Templating engine for the Views (Although i could hack this in myself)

Couchdb parsing a webclient.Result content in OPA

I am trying to use the webclient module to query the couchDB rest interface (I am using it instead of the opa couchdb api because I need to get a specific number of documents). Here is the code used to make the query: listmydocs(dburi)= match WebClient.Get.try_get(dburi) with | { failure = _ } -> print("error\n") | {success=s} -> match WebClient.Result.get_class(s) with | {success} -> print("{s.content}") | _ -&g

couchdb & futon - Is there a way to cancel a continuous replication using futon

Is there a way to cancel a continuous replication using futon ? One of my developers started getting this funny error, when trying to replicate a template DB to his work environment. Replicator failed: {error,{'EXIT',{badarg,[{erlang,apply,[gen_server,start_link,undefined]}, {supervisor,do_start_child,2}, {supervisor,handle_call,3}, {get_server,handle_msg,5}, {proc_lib,init_p_do_apply,3}]}}} After fiddling with it for a while, and testing I managed to reproduce the pr

Do a CouchDB reduce query for a single key

I have a CouchDB with following doc: { "name":"Chris", "tags":["mustache", "music", "couchdb"] } { "name":"Noah", "tags":["hypertext", "philosophy", "couchdb"] } { "name":"Jan", "tags":["drums", "bike", "couchdb"] } Map Function: function(dude) { if(dude.name && dude.tags) { dude.tags.forEach(function(tag) { emit(tag, 1); }); } } Reduce Function: function(keys, values) { return sum(values); } Now, if I query the view with the ?group=true paramet

Retrieving data from couchDB

I am new to couchDB but have a good experience working with relational databases. Can anyone tell how to connect to couchDB database and retrieve the data stored in it. I am giving an example in relational database and i need help regarding how to do similar task in couchDB.In mysql we use a connector to get connected to the database and the for example we give "select username from tablename where password="abc" ".

CouchDB with V8 instead SpiderMonkey

How can I run CouchDB with V8 JavaScript engine instead native JS based SpiderMonkey? I found this project https://github.com/dachev/couchv8, but it's outdated.

Couchdb Show function provides json

My CouchDB show function will not run the provides('json', ...) function. It will run the html provides in certain cases though. Here is the show function: function(doc, req) { provides('json', function(){ return {'json': doc }; }); provides('html', function(){ return "<html><body>html string here</body></html>"; }); return {'json': { 'hello': "goodbye" } }; } Here is a sample request when sending text/x-json. hello:goodbye is also re

What is a limit to the size of a single document CouchDb

I have a problem with document storage complex data structure, which may vary. Document need to store and retrieve whole. Need to provide a document search fields. I began to store documents in MongoBb, but the size of the document there is limited to 16 MB, which is not enough for me. What is the maximum size of a single document allows CouchDb?

Cordova Web App using PouchDB / CouchDB Schema Design

I'd like to use PouchDB with CouchDB because of the great syncing and replication features for my web app but have a difficult time finding the best way to model my data for what I need to do. The app lets a user create events in a calendar which can be shared only with users they choose. The users that are associated to that event can add comments and make changes to that event. 1) So far from what I understand, each user should have their own database to avoid accessing other user data if a

Couchdb Syncing PouchDB and Couchbase Sync Gateway - CORS Error

I need help syncing PouchDB with Couchbase Sync Gateway. I keep getting the following error that points to a CORS problem, but I've configured Couchbase Sync Gateway (CSG) for CORS according to their documentation. XMLHttpRequest cannot load http://localhost:4985/test-database/. No 'Access-Control-Allow-Origin'header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. I've tried the following config file per the CSG docs: http://developer.c

Error on running view and list function combination in couchdb

I am trying to use a view and list function combination in couchdb for returning multiple results, as following { "_id": "_design/noid", "_rev": "5-01bdadc2264f0d20fa2875beb9c264c3", "language": "javascript", "views": { "noid": { "map": "function (doc) {\n emit(doc.id,...}" } }, "lists": { "onefield": "function(head, req) {\n delete doc._id;\n delete doc._rev;\n provides('json', function() {\n return {'json': doc};\n });\n}" } } when I r

Couchdb Mango Performance vs Map Reduce Views

I've just noticed that in the release notes of Couchdb 2.0, it is mentionned that Mango queries are recommended for new applications. It is also mentionned that apparently Mango indexes are from 2x to x10 faster than javascript queries which really surprised me, as such I have a number of questions : Are Map/Reduce views being phased out ? I'm expecting the answer to be no since it seems to me that Mango does not cover all the use cases of Map/Reduce (the easiest example being Reduce itself),

Couchdb 2.0 extremely slow PUT over external network, fast locally

Environment: ubuntu 14.04 LTS, Erlang 19.3-1, libmozjs185-dev libmozjs185-1.0 libicu-dev, Couchdb 2.0 built from source Everything works perfectly, except posting data to Couchdb over the network results in around 60Kb/sec, whereas any other network operation runs at close to 10MB/sec (this is fast dedicated server with SSD disks). I am testing just with a simple curl (file.dat is a 5mb file) time curl -X PUT http://user:pass@myserver.com:port/test/doc1/file.dat -H "Content-Type: application/

Couchdb Finding documents with a time-range which intersect a given time-range

There is a list of documents P having two timestamps representing the time range [ P ] in which the document is valid. An index over these intervals was created: function (doc) { emit([doc.start, doc.end], someStuff(doc)); } We want to receive documents P wich start before some end timestamp E and stop after some start timestamp S: P(S, E) = { P | P_s <= E && P_e >= S } For instance, in a picture like this <-- TIME --> ..------------------S----------------------

call to eval() blocked by csp error shows in couchdb _list

can anyone help me to enable the use of Eval() and Function() in couchdb design document. I am trying to use eval() and Function methods in _list function but it always shows the below error when I call the list { "code": 500, "error": "render_error", "reason": "function raised error: (new Error(\"call to eval() blocked by CSP\", \"lists.testing\", 1)) \nstacktrace: ([object Object],[object Object])@lists.testing:1\nrunList(function (head, req) {var

Couchdb mango query speed

I have following type of documents: { "_id": "0710b1dd6cc2cdc9c2ffa099c8000f7b", "_rev": "1-93687d40f54ff6ca72e66ca7fc99caff", "date": "2018-06-04T07:46:08.848Z", "topic": "some topic", } The collection is not very large. Only 20k documents. However, the following query is very slow. Takes ca 5 secs! { selector: { topic: 'some topic' }, sort: ['date'], } I tried various indexes, e.g. index: { fields: ['topic', 'date'] } but nothing really worked well. What I am

Couchdb _users database does not exist

I've cloned some guy's web app and am trying to run the .js script they provided to extract data from a database. While I can run the project as a whole without a hitch, this particular script produces an error: { CouchError: not_found: Database does not exist. at Request._onResponse [as _callback] (c:\Users\bzlis\Documents\coup\node_modules\cradle\lib\cradle.js:241:29) at Request.self.callback (c:\Users\bzlis\Documents\coup\node_modules\request\request.js:185:22) at emitTwo (events.js:126:13)

Couchdb How to access DB/_local_docs on Cloudant without getting error "server_admin access is required for this request""

I want to retrieve the list of local documents an my Cloudant Bluemix CouchDB. Under CouchDB 2 i can GET /db/_local_docs to get a listing similar to _all_docs. Unfortunately Cloudant returns following error when i call the endpoint: {"error":"forbidden","reason":"server_admin access is required for this request"} I tried to access the endpoint while logged in as account owner into the Cloudant Dashboard as well as authenticated with an API key. I event tried to add an API key with the role

item ID name or ID inside item in json structure of couchDB, best performance?

The documentation of couchDB seem to only have examples of the format (leaving out parentheses here): [ {id: xyz, content: jfdsh}, {id: abc, content: lkjfd} ... ] I want to use the following format: [ xyz: {content: jfdsh}, abc: {content: lkjfd} ... ] No example in the docs uses this. 1) does this work and 2) is it performant? Firebase seems to opt for the latter for performance. But there are reasons to prefer couchDB... Grateful for insights!

Couchdb Does doc_count include doc_del_count for /db call

When I do a Get /{db} call, CouchDb documentation states the following: doc_count (number) – A count of the documents in the specified database. doc_del_count (number) – Number of deleted documents Does this mean doc_count excludes deleted document count?

How will one implement like and dislike counts, for a post, in Couchdb/Couchbase

How do one implement live like and dislike [or say views count] in couchdb/couchbase in the most efficient way. Yeah one can use reduce to calculate count each time and on front end only use increment and decrement to one API call to get results. But for every post there will be say millions of views, like and dislikes. If we will have millions of such post [in a social networking site], the index will be simply too big.

writing a map function in couchdb db that inserts another doc into a doc

I have two types of docs in my CouchDB database (doc.doc_type == doc1 and doc.doc_type == doc2) the structure of doc1 is something like this: { _id: 123123, _rev:1251231, doc_type: doc1, uid: 1 } The structure of doc 2 is like this: { _id: 123123, _rev:1251231, doc_type: doc2, uid: 1 docid: 1 } I want to write a view where I collate all the docs where the doc_type is doc1, but insert the doc2 as an array in doc1 through a map func. I had written a map

Couchdb How to make multiple IN ["V1", "V3","V5"] query

For a documents of that has the following structure { "countryCode": "US", "status" : "Pending" } where the countryCode has limited list of options (ISO country codes) and the status has a limited set of options too I need to select only the documents that are for the given list of countries basically and given list of statuses in SQL means it would be something like countryCode IN ["US","AR", "UK"] AND status IN ["P

couchdb change notifications

What does the changes API actually do? does it list the last revision of each document + deleted documents? or to put it this way: Can the change notifications feature of couchdb be used to list all the documents that match a query? For example, if I have the filter function: search = function(doc,req) { return (doc.min && doc.max && doc.min < req.query.q && doc.max > req.query.q) } will I get all the documents that match doc.min < somevalue < doc.max

CouchDB simple find

I have some couchDB database. and i want, as in mongodb, find one item. something like db.find({user : "John"}) That the easiest way to do it?

Problems syncing between pouch and a couchdb with server authentication

I'm having problems syncing between pouch and a couchdb with server authentication (no users or roles at database level). I'm using: Pouch.replicate(src, target, options, function (err, changes) { where src= 'default_client' and target = `'http://user:password@myhost:5984/default_client'` I get an error object object { status:0} and also NetworkError: 405 Method Not Allowed - http://myhost:5984/default_client/ I'm using couchdb 1.3 with cors enabled for all origins. Can anyone shed an

preventing google from indexing couchdb design document

I created a web application based on couchdb. It is hosted on cloudant.com (thanks guys, you from cloduant are wonderful!). The name of the app is R.I.D.E.::Research Infrastructure Database for EPOS . My problem is that when googling for it, if you insert the keywords "epos ride" then the first result is the design document... and this is absolutely not fine for my customers searching for the web app! As long as I understand it, it is not possible to: read_protect design documents (they con

CouchDB delete and replication

I'm having a problem with the replication of my couchDB databases. I have a remote database which gathers measurement data and replicates it to a central server. On the server, I add some extra parameters to these documents. Sometimes, a measurement goes wrong and I just want to delete it. I do that on the central server and want to replicate it to the remote database. Since I updated the document on the central server, there is a new revision which isn't synced to the remote. If I want to de

Most efficient way to create couchdb views

My CouchDB view indexes are being created slower than I would like. Writing the documents is not such a problem but the users can edit them offline and then bulk update, which seems to slow things right down. This answer helped but I was just wondering is it better to separate out various views into different design documents (eg1) or to store them all in one (eg2). Eg. 1 _design/posts/_view/id _design/comments/_view/id _design/tags/_view/id Eg.2 _design/webresource

The pricing programs of hosted CouchDB providers do not make sense

The holy grail of CouchDB is its replication feature. With TouchDB, Cloudant-Sync and Couchbase-Lite you can even replicate a database from\to the users' smartphones, so the data will be available even if there are connectivity problems. The CouchDB replication protocol (which may be implemented slightly differently across different frameworks\sdks) makes a GET request for every document that has changed. Both Cloudant and Iris-Couch provide pricing programs that are based on the size of the d

Does CouchDB limit the number of views per design doc?

I'd like to build an application that creates a new _view for each user of the application. I'm wondering about scale. A a million users (should we be so fortunate) does one long list of views within a design doc still function with some performance? Update: What I'm trying to accomplish I've got three types of docs that'll sit in my databse: docs that describe projects, docs that describe users, and docs that describe actions. Each action will belong to one and only one user, and one and only

Couchdb Couch DB/Pouch DB replication strategy by user roles

I am designing a mobile app for task management (to-do list plus lots of extra goodies) that can be used offline and sync up when reconnected. I have been impressed with Couch and Pouch DB but am still not sure on the best structure of databases and roles. My situation is that a user can have many tasks and tasks can be shared to many other users (read only) either directly or via assigning a task to a group and then sharing that group with specific users. After reading through the following qu

Couchdb How can I achieve one way sync in Couch DB

I am using Couch DB as a master DB for data and at the client side I have installed Pouch DB instances. Now, I would like to sync data from master to clients, but no client should have permissions to sync data back to the server. I know there is a one sided replication of db in Pouch/Couch Db but that doesn't restricts deliberate misuse of Couch db by unknown clients. (Any user can access my Couch DB instance's APIs and cause harm to it). Note: there is no authentication system for the client

Couchdb Cloudant Custom Sort

I have my data as follows { "key":"adasd", "col1"::23, "col2":3 } I want to see the results sorted in descending order of the ratio of col1/sum(col2) where sum(col2) refers to the sum of all values of col2. I am a bit new to cloudant so I don't know what the best way to approach this is. I can think of a few options. Create a new column for sum(col2) and keep updating it with each new value of col2 For each record,also create a new column col1/sum(col2). Then i can sort on th

Couchdb Possible to replicate couch database with illegal name

I'm using this command to replicate a 100mb database curl -H 'Content-Type: application/json' \ -X POST http://localhost:5984/_replicate \ -d '{"source": "http://example.com:5984/bad_name_with_underscore", "target": "good_name"}' I cannot replicate, because CouchDB says the source database name contains illegal chars. I can understand CouchDB folks discourage user to create bad database name, but reading from it is no harm. I'm not an admin of source CouchDB, so I tried to export data

Couchdb PouchDB.sync() fires 'complete' but PouchDB.replicate.from() with same options only fires 'paused' - why?

No complete event is fired when replicating using local.replicate.from(remote), only paused. { live: false } is being specified. According to the docs when live is set to false I should be getting a complete event. I don't see anything I recognise as errors in my CouchDB server log. I'm using pouch-browser 6.4.3 Local PouchDB options: { size: '1000', adapter: 'idb', auto_compaction: true, revs_limit: 1 } 'pull' code: local.replicate.from(remote, { live: false,

Couchdb Advanced Queries - Partial Match

I'm trying to figure out the best way to query very variable data in a Cloudant/CouchDB database. The only way for me to explain it is by showing an example: Database example { "_id": "1", "query-able_values": { "value-type-b": "some value", "value-type-c": "some other value", "value-type-d": "another value", "value-type-f": "yet another value", } } { "_id": "2", "query-able_values": {

ektorp / CouchDB update / synchronize folder

In jcouchdb there is an util class org.jcouchdb.util.CouchDBUpdater that allows to update documents from your local file system into CouchDB (used for example for copying design documents into CouchDB). Is there anything similar in ektorp?

Couchdb require is not defined when using PouchDB filtered replication

I have a bidirectional replication set up between PouchDB and CouchDB and I want to filter the replication so that only relevant documents end up in my local pouch. pouchDB('medic').sync('http://localhost:5984/medic', { live: true, retry: true, filter: 'medic/doc_by_place' }); When I execute the sync I get Uncaught ReferenceError: require is not defined from an anonymous function below. (function () { return function(){return require("lib/app")["filters"]["doc_by_place"].apply(this, ar

CouchDB - requesting _config and _log gives 404

Previously before couchdb 2.0, I can access _config and _log. But now, accessing those paths give me 404 and if I enable authentication those paths give 401 without authentication and 404 with authentication. The docs doesn't say anything about changes on this. So, why this happens?

CouchDB Index Error using ORDER BY in queries from Hyperledger Composer v0.18.0 to v0.19.0

I have an issue with CouchDB Index on a query with the ORDER BY statement while moving from Hyperledger Composer v0.18.0 to v0.19.0. Context: A Simple Asset called Event: asset Event identified by id { o String id o String name o EventType eventType o DateTime scheduledTime o EventStatus status } A Query with an ORDER BY statement: query getScheduledEvents { description: "Select all the SCHEDULED Events" statement: SELECT event.network.assets.Event

  1    2   3   4   5   6  ... 下一页 最后一页 共 9 页