Questions tagged [couchdb-nano]

Nano is the Official Apache CouchDB library for Node.js.

Nano is the Official Apache CouchDB library for Node.js.

132 questions
1
vote
1 answer

add an attachment to a document in couch db using nodejs

I want to update an existing document in couchdb. I have an image and i want to add it to an existing document in the db without lose the previus fields. I'm using nodejs with nano. tanks, this put me in the right orientation. At the end i do it in…
superpichon
  • 92
  • 1
  • 8
1
vote
3 answers

Temporary CouchDB View using Node module Nano

Nano doesn't provide documentation for temporary views, is there any undocumented method? Failing that, how would you advise somebody execute a temporary view using a nano-like syntax. Currently I am attempting to create the view as _view/guid,…
Dom Vinyard
  • 2,038
  • 1
  • 23
  • 36
1
vote
1 answer

Very slow inserts with CouchDB?

I wanted to check how many more inserts CouchDB can handle when compared to MySQL. My test was simple: for 10 seconds keep inserting {firstName: "Testing 001", lastName: "Testing 002"} and compare the number of documents/rows. The results I got were…
Lukasz Kujawa
  • 3,026
  • 1
  • 28
  • 43
1
vote
1 answer

Inserting binary attachment to CouchDB with nano

I'm trying to insert a binary attachment to CouchDB with nano. I have a JPG in data returned by http.request. I save it with nano as follows db.attachment.insert( id, 'content', self._data, contentType, {rev: rev}, function(err, body) { …
Lukasz Kujawa
  • 3,026
  • 1
  • 28
  • 43
1
vote
1 answer

read csv with headers then upload each row to couchdb using node/grunt

I would like to read a csv file and upload each row to a couchdb using a grunt task. At this point I am not yet doing any database validation such as checking if the record already exists but will have to do that at some point also. Currently this…
johowie
  • 2,475
  • 6
  • 26
  • 42
1
vote
1 answer

How can I automatically assign a role to a CouchDB user?

I have the following method for registering users: // Registration method exports.register = function(req, res) { var username = req.body.username, password = req.body.password, first = req.body.first; last =…
Willem Ellis
  • 4,886
  • 7
  • 38
  • 55
1
vote
3 answers

CouchDB clears document on insert?

I'm using nano with couchDB, and I am just trying to do a simple update on a document to add a new field. For example, let's say I have a document called foo. The only field in it right now is 'bar', with some value. I then attempt to do db.insert…
Ari
  • 3,489
  • 5
  • 26
  • 47
0
votes
1 answer

undefined function with now.js on the client-side

I'm using now.js with nano (CouchDB library) to fill a select with options. Server: everyone.now.getThings = function(thing) { var self = this; return db.view('lists', 'some_things', function(error, data) { var list =…
Patrick
  • 7,903
  • 11
  • 52
  • 87
0
votes
1 answer

JavaScript Callback with nano and now.js

everyone.now.getGuess = function(val) { db.view('lists', 'project_names', { startkey: val, endkey: val + "\u9999" }, function(_, data) { return data.rows.map(function(obj) { return obj['key']; }); }); return…
Patrick
  • 7,903
  • 11
  • 52
  • 87
0
votes
0 answers

CouchDB deleting and recreating document gives conflict

I need to recreate a document in CouchDB. I use nano package, but I think the problem is the same with API calls. What I'm currently doing is to make two calls: await dbHandle.bulk({docs: [{_id: "abc", _rev: "12-aaaa", _deleted: true}]}); await…
SiliconValley
  • 1,465
  • 17
  • 30
0
votes
1 answer

What happens in CouchDB when I create an index repeatedly?

To implement sorting, in CouchDB we have to create an index (otherwise the corresponding mango query fails). I haven't found a way to do this in Fauxton (if I have missed something, please comment in Github), so I've decided to create it…
YakovL
  • 7,557
  • 12
  • 62
  • 102
0
votes
0 answers

Couchdb nano fails to connect to database

Couchdb runs fine through the command prompt, however, when I try to access a db through nano I get a ECONNREFUSED error. I am using nano version 10.0.0 and I have couch db installed locally and running on port 5984. Here is my code: const nano =…
0
votes
1 answer

How can this "nano" error in JavaScript be solved?

/home/admin/.pm2/logs/app-error.log last 15 lines: 3|app | at Object. (/home/admin/pcpro-backend/helper/db.helper.js:1:29) 3|app | at Module._compile (internal/modules/cjs/loader.js:1085:14) 3|app | at…
0
votes
1 answer

Node.js CouchDB and Nano 'error happened in your connection'

I have been looking around for well over 2 hours now trying to find SOMETHING that would give me any kind of direction with this issue but simply cannot find it. I am using Node.js and CouchDB with docker-compose. I am also using express and nano. I…
ConnerWithAnE
  • 1,106
  • 10
  • 26
0
votes
0 answers

Handling Error: connect ECONNREFUSED 127.0.0.1:5984 in nano couchdb

I'm setting up a login system with nano, passport and couchdb. Things are mostly working but when couchdb is offline I'm given this error: (node:893) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5984 at…
1 2 3
8 9