couchdb

is there a way to clear duplication record from results?

♀尐吖头ヾ 提交于 2019-12-12 06:08:50
问题 I have a view but did have duplicated documents from the results of view as like following, how can I get the duplicate results and get the unique? thank you in advance { "total_rows": 9, "offset": 0, "rows": [ { "id": "xxxx", "key": "12345", "value": { "_id": "abc123", "_rev": "4-8db4da81d1e20afcea0a328fb16e7ec8", "field1": "abc", "field2": "dfr" }, { "id": "xxxx", "key": "12345", "value": { "_id": "abc123", "_rev": "4-8db4da81d1e20afcea0a328fb16e7ec8", "field1": "abc", "field2": "dfr" }, ]

Cloudant - apply a view/mapReduce to a geospatial query

折月煮酒 提交于 2019-12-12 05:47:27
问题 HI I'm new to cloudant (and couch and asking questions on stackoverflow so I hope I manage to be vaguely clear about what I'm asking ) and I'm trying to do probably the second most basic geo task but am hitting a dead end. I've got a database of docs which are geojson objects, I've created an index so I can query for intersections etc but it seems the only options I have in the url is the format=legacy (gives me the ids) and the format=geojson and the include_docs parameter - what I'd like to

CouchDB Querying Dates

百般思念 提交于 2019-12-12 05:42:22
问题 I'm collecting temperatures in CouchDB and would like to query for the average temperature by room, year, month, day, hour. Unfortunately, when I execute my query (see below) I'm getting all months, not just the month I specify in my query. However, if I specify just a single room I get only the month I specify in my query. How do I query all rooms for just a specified period? Map Function: function(doc) { if(doc.type == "TempHumid"){ var d = new Date(doc.datetime); for(var i in doc.path)

CORS issue between UI and couchDB

我的未来我决定 提交于 2019-12-12 04:45:02
问题 I have CORS issue between UI and couchdb. But in couchdb CORS is enabled, and UI has res.header("Access-Control-Allow-Origin", "*"); header. But I still have an error XMLHttpRequest cannot load http://localhost:5984/cp_display_template/. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost' is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute.

Qt Python GUI Crashes on Button Click

孤街浪徒 提交于 2019-12-12 04:32:10
问题 The code is smaller version I put together to demonstrate what I am trying to do. I just need to get information from a QButtonGroup of radio buttons. Specifically the text of which one has been clicked. However, when I run click the button in the GUI python crashes. There is no error message so I can't pinpoint the cause. Below is the example code, below that is the image show upon clicking a radio button: Working earlier with a more inefficient method I got to sending commands to the server

Angular: get cookie from one request and use in another

独自空忆成欢 提交于 2019-12-12 03:35:51
问题 I have simple Angular app, which can perform some requests over $http to remote service (couchdb) at example.com/.../myservice . Service requires auth, which done by calling specified address example.com/_session with name and password and it returns with session cookie AuthSession . Problem is that cookie is not used when calls to service is done. Maybe problem caused because cookie is per-session Http-only (and that's can't be changed). I think the solution is grabbing cookie from auth

Issue in PreparedAttachment in Cloudant

两盒软妹~` 提交于 2019-12-12 03:33:41
问题 Last 2 or 3 days i am getting issue in attachment download when app are sync first time with cloudant. Error log is:- W/PreparedAttachment: Problem reading from input or writing to output stream java.net.ProtocolException: unexpected end of stream at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:449) at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168) at java.io.InputStream.read(InputStream.java:162) at com.cloudant.sync

Couchdb illegal database name issue during replication (unwanted , added after db name)

大城市里の小女人 提交于 2019-12-12 03:25:29
问题 I am trying to replicate a couchdb database using filters. This is my code that I am running using Command Prompt: curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d '{"source": "http://localhost:5984/source_database", "target": "http://localhost:5984/testdb", "create_target": true, "continuous": true, "doc_ids": ["000803f8-7f61-4afd-b532-8e6c1028d965"]}' I get the following error: Illegal database name, Reason, name:'testdb, '. For some reason, an unwanted

How can get newest document just using the map

冷暖自知 提交于 2019-12-12 03:06:57
问题 I have document like the following, I want to use map function to get the latest status with given UserId doc1: _id=id1, UserId='ABC', status='OPEN',... doc2: _id=id2, UserId='BCD', status='OPEN', ..... doc3: _id=id3, UserId='ABC', status='CLOSED'.... For a given userid, if it related two status: open and close, then return that document with close status document For a given userid, if it related just open status, then return that document with open status document doc1: _id=id1, UserId='ABC

Reduce output must shrink more rapidly — Reducing to a list of documents

自古美人都是妖i 提交于 2019-12-12 02:35:53
问题 I have a few documents in my couch db with json as below. The cId will change for each. And I have created a view with map/reduce function to filter out few documents and return a list of json documents. Document structure - { "_id": "ccf8a36e55913b7cf5b015d6c50009f7", "_rev": "8-586130996ad60ccef54775c51599e73f", "cId": 1, "Status": true } Here is the sample map: function(doc) { if(doc.Key && doc.Value && doc.Status == true) emit(null, doc); } Here is the sample reduce: function(key, values,