couchdb

CouchDB / Couchbase view ordered by number of keys

梦想与她 提交于 2020-01-05 08:03:48
问题 I'm trying to write a view which shows me the top 10 tags used in my system. It's fairly easy to get the amount with _count in the reduce function, but that does not order the list by the numbers. Is there any way to do this? function(doc, meta) { if(doc.type === 'log') { emit(doc.tag, 1); } } _count As a result I'd like to have: Tag3 10 Tag1 7 Tag2 3 ... Instead of Tag1 7 Tag2 3 Tag3 10 Most importantly, I do not want to transfer the full set to my application server and handle it there. 回答1

CouchDB and Special Characters

ぃ、小莉子 提交于 2020-01-05 05:57:06
问题 Question...I am trying to add data to CouchDB via the _bulk_docs API. For the most part I have this working, but any JSON value that contains a special character (e.g. certain Spanish or French characters exist in my data) results in an "invalid JSON" error given by CouchDB, and the data is rejected. I'm not sure what I need to set in order to get this to work. Any suggestions? CouchDB seems to get the data properly (at least it looks correct in its log file), but it is not processed unless I

Custom rest api's for CouchDB?

北城余情 提交于 2020-01-05 05:00:50
问题 I have been googling around trying to find examples or just a straight answer to my question. Is it possible to create/extend my own custom api endpoints for couchDB? Such as for example can I create a api call like http://127.0.0.1:5984/database/FillDatabase/... to fill the database with data? If couchDB does indeed provide this functionality, then please provide me with a link perhaps to some tutorial/guide/example if possible. Thanks. 回答1: You may want the _rewrites feature, which allows

Couchdb database-per-user design document management

让人想犯罪 __ 提交于 2020-01-05 04:08:06
问题 I am evaluating Couchdb for a web application where there would be many users. If I use the database-per-user model, presumably the design documents in every database will all be identical. I have not found any mention of 'global' design documents acting upon multiple databases, or of any tools to make it easy to change the design docs across all user databases. How is this handled? 回答1: You can setup continuous replication between a template database that contains all your design documents.

CouchDB Full Text Search

左心房为你撑大大i 提交于 2020-01-05 02:24:11
问题 i need some direction about full text search in couchdb. Is it already enabled by default in 2.0, or do we have to rebuild couchdb enabling it? Scenario: It is a document management system, documents are shown in a grid. I need to be able to sort results. After several changes from map reduces to elastic indexes, now i am trying to use mango queries. Problem is that sorting does not give the expected results. { "selector": { "directoryName": { "$eq": "mail\\test\\inbox" }}, "sort": [{"subject

PouchDB fails to sync on iOS 9 - iPhone 5S

ε祈祈猫儿з 提交于 2020-01-04 07:11:33
问题 I am developing an app with IONIC and PouchDB. The app perfectly synchronizes with remote CouchDB and works perfectly well on Android. But the PouchDB fails to sync on iOS. I am testing on iOS 9 and iPhone 5S. What could be going wrong with the code in iOS ?? 回答1: Are you using WKWebView? PouchDB does not support WKWebView, unless you use the FruitDOWN adapter: http://pouchdb.com/adapters.html#pouchdb_in_the_browser 来源: https://stackoverflow.com/questions/35293323/pouchdb-fails-to-sync-on-ios

PouchDB fails to sync on iOS 9 - iPhone 5S

坚强是说给别人听的谎言 提交于 2020-01-04 07:11:27
问题 I am developing an app with IONIC and PouchDB. The app perfectly synchronizes with remote CouchDB and works perfectly well on Android. But the PouchDB fails to sync on iOS. I am testing on iOS 9 and iPhone 5S. What could be going wrong with the code in iOS ?? 回答1: Are you using WKWebView? PouchDB does not support WKWebView, unless you use the FruitDOWN adapter: http://pouchdb.com/adapters.html#pouchdb_in_the_browser 来源: https://stackoverflow.com/questions/35293323/pouchdb-fails-to-sync-on-ios

CouchDB multi level view map function?

岁酱吖の 提交于 2020-01-04 06:57:08
问题 I'm not quite sure what to call what I'm trying to achieve, but will explain it as much as possible. I am trying to use a view to return information from separate documents that are related like a hierarchy. For example, I have these three documents. { "_id" : "line_2c7e12d1", "docType" : "Line", "lineNumber": 30, "pageId" : "page_89bdd679f" } { "_id" : "page_89bdd679f", "docType" : "Page", "pageNumber" : 65, "bookId" : "book_3684caa2b" } { "_id" : "book_3684caa2b", "docType" : "Book",

How is Cloudant different from and related to CouchDB?

我的未来我决定 提交于 2020-01-04 06:02:47
问题 The only thing I understand so far is that Cloudant provides cloud support and uses CouchDB in the backend. 回答1: Cloudant vs CouchDB 1.6 Cloudant is horizontally scalable (with respect to data size), CouchDB isn't Cloudant offers full text search, CouchDB doesn't Cloudant has a different authentication system Cloudant has Cloudant query which allows you do declaratively set indices and query the DB. With CouchDB, you have to use views. Cloudant vs CouchDB 2.0 Cloudant offers full text search,

C#, HTTPClient - IfMatch format requirements?

时光总嘲笑我的痴心妄想 提交于 2020-01-04 05:57:07
问题 I am using the System.Net.Http.HttpClient found in .Net 4.5 in conjunction with CouchDb. I have a revision of a document being: 3-789d4d2b33bf4505f8f23fd4a1025a4e . The issue is that I can't get that to work with the If-Match header flag on the request. var req = new HttpRequestMessage(HttpMethod.Delete, url); req.Headers.IfMatch.Add( new EntityTagHeaderValue("3-789d4d2b33bf4505f8f23fd4a1025a4e")); The EntityTagHeaderValue causes a format exception: "The format of value '3