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
2
votes
1 answer

Find and return specific fields

I am having some trouble using the nano wrapper for couchDB within NodeJS: https://github.com/dscape/nano My question is, how do I find and return all users whose email matches 'foobar@baz.com?'. What if I only wish to return the name field? I am…
ejang
  • 3,982
  • 8
  • 44
  • 70
2
votes
2 answers

CouchDB getting all posts from user in Node.js

I'll start off by saying I've done a lot of research but I'm still pretty lost. I have a working version, but it's the most inefficient way you can do this I'm sure. I'm not super confident about knowing the best way to plan out a DB, I've become to…
film42
  • 1,095
  • 12
  • 22
1
vote
4 answers

callbacks and returns with CouchDB and nano.js

I'm trying to write a small library with re-usable database calls with nano. db.view('list', 'people', function(error, data) { if (error == null) { res.render('people/index', { people: data.rows }); } else { // error …
Patrick
  • 7,903
  • 11
  • 52
  • 87
1
vote
1 answer

CouchDB _rev conflict issue while updating bulk documents

I am trying to update bulk documents using nano couch package from npm (https://www.npmjs.com/package/nano) but sometimes due to different _rev for same document , couch is skipping the update for those documents . But in my case i want to update…
1
vote
1 answer

couchDB unable to create a database with node.js

I am new to node.js (just few days in) and am learning through a tutorial from youtube (don't know if it's allowed to post a link or not). I am trying to create a database in couchDB. Everything works fine but as soon as I try to enter any details…
Divyansh
  • 11
  • 3
1
vote
1 answer

CouchDB Mango query - Match any key with array item

I have the following documents: { "_id": "doc1" "binds": { "subject": { "Test1": ["something"] }, "object": { "Test2": ["something"] } }, }, { "_id": "doc2" "binds": { "subject": { "Test1":…
Marcelo Machado
  • 1,179
  • 2
  • 13
  • 33
1
vote
2 answers

CouchDB View Sort by Value

I am looking for a poor perfomance solution to sort my couchdb view by value (because large data). I am using on my NodeJS Application the "nano" package to get the database/view connection. I created a CouchDB View Map Function configure a key…
blizzer
  • 29
  • 5
1
vote
1 answer

Pass arguments in couchdb-nano view function

I am using nodejs's nano npm module and couchdb to get the total number of documents based on a status message that I should be able to pass in a couchdb view. The view looks like the following. { _id: "_design/docCount", views: { …
Phantom007
  • 2,079
  • 4
  • 25
  • 37
1
vote
1 answer

How to define an index to use in a Mango Query

I am trying to create a CouchDB Mango Query with an index with the hope that the query runs faster. At the moment I have the following Mango Query which returns what I am looking for but it's slow. Therefore, I assume, I need to create an index to…
Dogahe
  • 1,380
  • 2
  • 20
  • 50
1
vote
1 answer

CouchDB Update Handler: doc update/insert using Nano

I am storing some locale based data in the following format in the CouchDB. { "_id": "a62f81b5afad1857c2f6399db500c73b", "_rev": "3-923e5ed468e0f617f09057035b41051a", "type": "CAT", "origin_id": "1", "locale": "ar", "values_translation":…
mapmalith
  • 1,303
  • 21
  • 38
1
vote
0 answers

"Referer header must match host." when trying to use _find

I'm working with CouchDB and am trying to search a db using _find. I am currently running into the following error: error: 'bad_request', reason: 'Referer header must match host.', scope: 'couch', statusCode: 400, request: { method:…
1
vote
2 answers

Async Await style call working for nano.db.insert but not for nano.db.list

I am using https://github.com/apache/couchdb-nano to interact with my couchdb instance, in my nodeJS project. const nano = = require('nano')('http://127.0.0.1:5984'); const eventsDb = nano.db.use('events'); const savedEvent = await…
oomer
  • 159
  • 3
  • 13
1
vote
0 answers

How to replicate data with filter in CouchDB using nano library

I have a problem in replication with filter. Everything works ok, but when i would like to change the category name which pass the filter in source db, the same record in target database still exists, but it doesn't pass the filter now, so the…
MarMar1236
  • 41
  • 1
  • 6
1
vote
0 answers

passing non-url encoded parameters to an ajax call in node.js

I am trying to pass parameters from my website to a couchdb server through a node.js server. I absolutely need to pass {} in a url. Not a string, not an empty object, the actual {} characters. It is used to define the end_key parameter in couchdb…
Chapo
  • 2,563
  • 3
  • 30
  • 60
1
vote
0 answers

How to type database response document

I am trying to use CouchDB, and it's nano npm library that has typescript types. I managed to insert documents, however I don't know how to type a response document. Here is the function that gets the data: export const getAlarms = async ():…
Vlives
  • 405
  • 1
  • 4
  • 8
1 2
3
8 9