couchdb-futon

Couchdb - Block futon for readers users

限于喜欢 提交于 2019-12-10 02:17:10
问题 I want to know how block the acess to futon (_utils) in couchdb for readers, allowing the access only for admins. I need to do this why if a reader user acess the futon he can see the name of all my databases and how many documents there are. My application should let a reader acess an document only if he have the id of them. 回答1: Even if you block futon, people will be able to find the list of databases using the couchdb API. I think the right solution is to put a webserver in front of

Is it good practice to give each CouchDB user a separate database?

坚强是说给别人听的谎言 提交于 2019-12-09 16:52:07
问题 I have a bit of conceptual question regarding the structure of users and their documents. Is it a good practice to give each user within CouchDB their own database which hold their document? I have read that couchDB can handle thousands of Databases and that It is not that uncommon for each user to have their database. Reason: The reason for asking this question is that I am trying to create a system where a logged in user can only view their own document and can't view any other users

How can I make user creation public but read access private in CouchDB?

 ̄綄美尐妖づ 提交于 2019-12-07 07:56:45
问题 I'd like to make user creation public, so that unauthenticated users can create new accounts in _users , but only give read privileges to admin roles. Is this possible? How? 回答1: CouchDB 1.1.0 and the upcoming 1.1.1 do not support this. The best you can do is to have a public database where users submit requests to create user accounts, and you have a standalone tool to react to that and create normal user accounts. (The standalone tool could simply be a dedicated web page you log in to as

Identifying Duplicates in CouchDB

徘徊边缘 提交于 2019-12-07 04:37:31
问题 I'm new to CouchDB and document-oriented databases in general. I've been playing around with CouchDB, and was able to get familiar with creating documents (with perl) and using the Map/Reduce functions in Futon to query the data and create views. One of the things I'm still trying to figure out is how to identify duplicate values across documents using Futon's Map/Reduce. For example, if I have the following documents: { "_id": "123", "name": "carl", "timestamp": "2012-01-27T17:06:03Z" } { "

Find The Duplicate value in CouchDb

蓝咒 提交于 2019-12-06 06:07:29
I want to find same value in CouchDB. My Map is function(doc) { var user = []; if(doc.type = 'user'){ user.push(doc.name); emit( doc.type, user); } } And I have the results like ["Bob"],["Peter"],["Bob"] .... I'd Like to Have a reduce like ["Bob","Peter","Bob"] Or an Array with only duplicate ["Bob","Bob"] I don't understand How reduce works. foreach value reduce is called or only when the map is finished? Let's say you have the following three documents. Bob: { "_id": "89d9ffe10a33df504ecc8d7c9a975eed", "_rev": "1-dfc3128d8d80760f2cf40328dd24553e", "type": "user", "name": "Bob" } Peter: { "

Delete couchDB databases

被刻印的时光 ゝ 提交于 2019-12-06 02:56:45
Is there a way to delete multiple databases in Futon? Instead of creating multiple documents in one database, by mistake I ran erlang query and created about 3000 databases. Can I delete them in bulk all together? Thanks You can't do this in bulk with Futon. However, if you have access to the server itself via SSH, you can simply delete the database files in /var/lib/couchdb/ . 来源: https://stackoverflow.com/questions/20105948/delete-couchdb-databases

Identifying Duplicates in CouchDB

試著忘記壹切 提交于 2019-12-05 07:53:06
I'm new to CouchDB and document-oriented databases in general. I've been playing around with CouchDB, and was able to get familiar with creating documents (with perl) and using the Map/Reduce functions in Futon to query the data and create views. One of the things I'm still trying to figure out is how to identify duplicate values across documents using Futon's Map/Reduce. For example, if I have the following documents: { "_id": "123", "name": "carl", "timestamp": "2012-01-27T17:06:03Z" } { "_id": "124", "name": "carl", "timestamp": "2012-01-27T17:07:03Z" } And I wanted to get a list of

How can I get a map/reduce result which is sorted within descending order of the “value” value?if also using list function can achieve that?

霸气de小男生 提交于 2019-12-04 06:12:50
问题 I have view map and reduce like this: Map: function(doc) { if(doc.type){ var usersLength = doc.users.length; for (var i = 0; i < usersLength ; i++) { emit([doc.users[i].userid,doc.Service.ownId], 1); } } } Reduce: function(keys, values, rereduce) { return sum(values); } Then invoke the view like this: _design/aaa/_view/getUserId?group=true&group_level=2&startkey=["111111"]&endkey=["111111",{}] I can get the result set below: {"rows":[ {"key":["111111",""],"value":7}, {"key":["111111","FFFF26"

How can I get a map/reduce result which is sorted within descending order of the “value” value?if also using list function can achieve that?

a 夏天 提交于 2019-12-02 10:06:57
I have view map and reduce like this: Map: function(doc) { if(doc.type){ var usersLength = doc.users.length; for (var i = 0; i < usersLength ; i++) { emit([doc.users[i].userid,doc.Service.ownId], 1); } } } Reduce: function(keys, values, rereduce) { return sum(values); } Then invoke the view like this: _design/aaa/_view/getUserId?group=true&group_level=2&startkey=["111111"]&endkey=["111111",{}] I can get the result set below: {"rows":[ {"key":["111111",""],"value":7}, {"key":["111111","FFFF26"],"value":1}, {"key":["111111","FFFF44"],"value":7}, {"key":["111111","FFFF34"],"value":2} ]} However,

How to get from CouchDB only certain fields of certain documents with a single request?

亡梦爱人 提交于 2019-12-02 06:02:19
问题 create a view that return only a subset of values from a document, each with its key and value within a json string. like if one given view returns a document as this following, Is it possible to get some fields information for a one request? thank you { "total_rows":10, "offset":3, "rows":[{ "id":"doc1", "key":"abc123", "value": { "_id":"aaaa", "_rev":"bbb", "field1":"abc", "field2":"bcd", "field3":"cde", "field4":"123", "field5":"789", "field6":"aa@email.com", "field7":"ttt", "field8":"iii"