cloudant

index and query items in an array with mango query for cloudant and couchdb 2.0

ⅰ亾dé卋堺 提交于 2019-12-23 02:23:04
问题 I have the following db structure: {"_id": "0096874","genre": ["Adventure","Comedy", "Sci-Fi" ]} {"_id": "0099088","genre": ["Comedy", "Sci-Fi", "Western"]} and like to query it like I could do in mongodb db.movies.find({genre: {$in: ["Comedy"]}}) It works when i use a text index for the whole database, but that seems very wasteful: // index { "index": {}, "type": "text" } //query { "selector": { "genre": { "$in": ["Comedy"] } }, "fields": [ "_id", "genre" ] } The following index does not

Adding functions in search index of loudant

怎甘沉沦 提交于 2019-12-20 06:35:23
问题 I have a Json document in cloudant as: { "_id": "3-f812228f45b5f4e4962505561953ew245", "_rev": "3-f812228f45b5f4e496250556195372b2", "wiki_page": "http://en.wikipedia.org/wiki/African_lion", "name": "african lion", "class": "mammal", "diet": "herbivore" } I want to make a search index that can search this document when I input queries as "afrian lion" or "lion african",... I make a function that can return all cases of permutation in "doc.name" for indexing (This function works well and it

Creating view in Cloudant (CouchDB) based on an object property value

百般思念 提交于 2019-12-19 03:37:16
问题 I've been trying to find a solution for this requirement but I've hit many dead ends. I'm using Cloudant as my data store of user documents. Each user document has a field (property) called 'items', which is an array of objects. So a user document looks like this: { "_id":"userid1", "_rev":"XX", "username": "foobaruser" "items": [ { "date":1357879144069, "text":"don't cry because it's over, smile because it happened.", "cat":"determination" }, { "date":1357879179209, "text":"those who mind

Updating and Deleting documents using NodeJS on Cloudant DB

有些话、适合烂在心里 提交于 2019-12-13 18:05:59
问题 I was able to successfully query(select) and insert data into Cloudant database using HTTP /REST API. But I am not able to figure out - how to delete and modify documents. For Delete: I tried the following code in nodejs path : '/quick_loan_nosql_db_1?951b05d1b6aa100f4b94e5185674ef40/_rev=1-88963c755157188091f0d30115de18ce' part of the REST API Request with METHOD: DELETE. But when I execute it deletes the entire database instead of the ID being specified. For Update : Can some one provide a

The value type for json field XXXX was presented as YYYY but the discovered data type of the table's column was ZZZZ

眉间皱痕 提交于 2019-12-13 07:24:51
问题 When using the SDP to extract data from Cloudant and populate dashDB, I occasionally see error messages in the dashdb "XXXX_OVERFLOW" table that look like this: EXCEPTION The value type for json field XXXX was presented as java.lang.String but the discovered data type of the table's column was Boolean. The document could not be imported into the created database. _ID mydocument-12345 Questions Why am I getting this error? How can I fix it? 回答1: The SDP has to decide a matching SQL data type

Java couchdb4j DB connection

一世执手 提交于 2019-12-13 05:24:21
问题 I'm using couchdb4j to establish a connection with couchDB. It's working fine when im connecting to my local db, this is the code for that: Session LocalSession= new Session("localhost", 5984); But i'm trying to get a connection with this site: stockquotetest.cloudant.com but it's not working, can anybody spot the problem? Session NewSession = new Session("stockquotetest.cloudant.com/", 5984, "user", "pass"); i'm getting this error: INFO: basic authentication scheme selected I also get this

How to download a multipart wav file from cloudant database and save locally using Node JS and REST API?

泪湿孤枕 提交于 2019-12-13 03:15:07
问题 I am stuck in retrieving multipart from cloudant using Node JS API. Hence, I used REST API to download the wav file from cloudant database. But its not downloading wav file from https URL. When I enter the https URL directly in browser, it prompts me to save file locally. So, the URL is correct. Here is the code for REST API: var request1 = require('request'); var filestream = fs.createWriteStream("input.wav"); var authenticationHeader = "Basic " + new Buffer(user + ":" + pass).toString(

Cloudant - Internal Server Error

独自空忆成欢 提交于 2019-12-12 06:56:05
问题 Cloudant local data edition version : 1.0.0.3 Linux distribution and version : centos 6.6 I recently installed Cloudant local data edition , configured it properly on 4 node cluster(1 load balancer and 3 data nodes). everything looked fine then fired some curl command to create , retrieve and delete databases but got internal_server_error. When i launched cloudant dashboard and got entered as admin , the specified operation actually was occuring but on terminal i got error messages. Command

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

unable to push node.js cloudant app to bluemix

自古美人都是妖i 提交于 2019-12-12 05:45:41
问题 I tried to add cloudant to my app and all of a sudden I can't push it to bluemix anymore. I tracked it down to 1 line which caused the problem: var cloudant = require('cloudant'); prior to this it uploaded with no problems. During the push everything seems fine until it reached the end when it tried to restart the droplet -----> Uploading droplet (20M) 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1