cloudant badmatch error when using deisgn document but the same query works when not using views - cloudant

Can someone please help me resolve the query error when using views?
I run this inside cloudant docker container where this issue shows up intermittently. I cannot reproduce the problem on all container starts but wanted to check how to resolve this without having to delete and re-create the container. Appreciate any help.
curl --user admin:pass "http://localhost:/basic/_design/example/_view/foo"
{"error":"badmatch","reason":"{error,enoent}","ref":2451670243}
curl --user admin:pass "http://localhost:/basic/_design/example"
{"_id":"_design/example","_rev":"1-230141dfa7e07c3dbfef0789bf11773a","views":{"foo":{"map":"function(doc){ emit(doc._id, doc._rev)}"}}}

Related

Mongodb: 'mongod' command not starting the local server

I have recently downloaded the mongodb ,, and try trying to run the mongod command and it just not running the local server , it throwing error repeatedly,
output screen when I am running the 'mongod' command
I have almost tried all the possible way to solve it , but not getting resolved.
please help if anyone know the solution.

SyntaxError: Missing semicolon when trying to export Mongo Atlas collection to local machine

I am having a problem exporting a collection from Mongo Atlas to my local machine. I have tried several different formats including this one, which I found in the official Atlas documentation on importing and exporting data.
First I log into my Atlas like so:
mongosh "mongodb+srv://cluster0.oyvrw.mongodb.net/dbname" --username uname
Then I try the command from the official docs:
mongoexport --uri mongodb+srv://uname:password#cluster0.oyvrw.mongodb.net/dbname --collection colname --type json --out cats.json
I have looked around at other similar questions and tried everything I can find online without success. One suggestion was not to run the command from the mongo shell but from the regular command line, but this does not work either.
It seems like it should be easier to get a collection out of Atlas to JSON. Any help or suggestions are much appreciated. Thanks!
For anyone facing this error, the mongoexport command does not work with mongosh. It must be run with the system shell.
However, mongoexport is part of mongo-database-tools, which as of MongoDB 4.4, is released separately. As a result, running mongoexport in the system shell will throw a command not found if the installed version of MongoDB is 4.4 or greater.
To solve this you can install the database tools using homebrew:
brew install mongodb/brew/mongodb-database-tools
Of course, make sure you have homebrew already installed. If not a quick Google will help.
Then following command should work to perform an export:
mongoexport --uri mongodb+srv://<username>:<password>#cluster0.oyvrw.mongodb.net/<dbName> --collection <collectionName> --type json --out /Users/macuser/desktop/exportBU.json
Hope that helps anyone having similar problems getting data in/out of MongoDB.

Rank & Retrieve, Failed to connect to gateway.watsonplatform.net

I am trying to create a Create Solr cluster using java class as given in steps on below link as shown here
but i am getting following error, can this be firewall issue?
Using JAVA
com.ibm.watson.developer_cloud.service.WatsonService execute SEVERE: IOException java.net.ConnectException: Failed to connect to gateway.watsonplatform.net/:443 at com.squareup.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:139) at com.squareup.okhttp.internal.io.RealConnection.connect(RealConnection.java:108) at com.squareup.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184) at com.squareup.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126) at com.squareup.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95) at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281) at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224) at com.squareup.okhttp.Call.getResponse(Call.java:286) at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243) at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205) at com.squareup.okhttp.Call.execute(Call.java:80) at com.ibm.watson.developer_cloud.service.WatsonService.execute(WatsonService.java:122) at com.ibm.watson.developer_cloud.service.WatsonService.executeRequest(WatsonService.java:183) at com.ibm.watson.developer_cloud.retrieve_and_rank.v1.RetrieveAndRank.createSolrCluster(RetrieveAndRank.java:168) at Test.artf.CreateASolrClusterExample.main(CreateASolrClusterExample.java:20)
Using CURL
When i try using curl command as below that also gives connection error as below.
curl -X POST -u "":"" "https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters" -d ""
Response:
curl: (7) couldn't connect to host
when i put the link in curl command in crome, it pop up for id/password. After giving id/password returns me
{"clusters":[]}
The service is experiencing some issues currently; the team is aware and working on it. Sorry for the trouble, please try again in a little while.

Solr Admin UI Error 500 #/Object Expected

I need help here. Used Solr and process 2 commands: start and create a core. But when I try to access the Admin UI, It pops up this error
500 Error get #/Object Expected
and I cannot see the dashboard. The commands I used is just 2 simple steps:
bin\solr start
bin\solr create -c Test
The cmd shows that the core is created successfully. Does anyone knows why?
I using solr 5.1.0 and java version 1.7. Thanks a lot.

DigitalOcean Rake db:seed command not found

I am trying to update my database, which is stored at a DigitalOcean-server. The seeds.rb-file is on the server atm, but I don't know what to type in the console window. When I type "rake db:seed", I get "Command not found". I would have been very thankful if you could help me! :-)

Resources