Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Félix Sanz
    @felixsanz
    does nano uses promises?
    William Hetherington
    @willwh
    hi guys
    I’m trying to understand search
    can I search a field for instances of a string and return the doc?
    is that how that works?
    logs: (thing, callback) => {
          nano.db.use(‘mydb').search('log', 'logs', { message: ’searchstring’}, (err, data) => {
          callback(err, data);
        });
      },
    where I have a field in my logs view called message
    Error: missing handler: _search
    so I guess I am doing something wrong
    hmm
    William Hetherington
    @willwh
    ah I misunderstood
    William Hetherington
    @willwh
    @dscape ping
    Matt Crummey
    @mcrummey
    @tnguyen14 @felixsanz nano does not support promises. There are several wrappers that do.
    Tri Nguyen
    @tnguyen14
    @mcrummey do you recommend any of them?
    Tri Nguyen
    @tnguyen14
    ok thanks, I'll take a look
    Matt Crummey
    @mcrummey
    for promises and generators(async/await)
    Raymond Wanyoike
    @rwanyoike
    hello. i'm trying to understand nano tests. I don't have a JS background, but I note that nano uses a mock lib. How are the functions tested? Is it using a real couchdb, or mocking responses, etc. Thanks.
    Matt Crummey
    @mcrummey
    Hey Raymond, it looks like they have both mocked and unmocked tests.
    npm run mocked && npm run unmocked
    "npm test" runs the unmocked tests
    John Pape
    @jpapejr
    Speaking of testing… I’m looking for a simple way to check for the presence of a specific database in couch for a mocha test.. Any ideas? db.head? db.use() then something?
    David Brown
    @browndav
    In https://github.com/dscape/nano/blob/master/lib/nano.js#L64, it looks like (.*)@ is used to match the text up until the first occurrence of @ instead of the non-greedy (.*?)@. Seems reminiscent of the recent Lastpass vulnerability (e.g. https://foo:bar@host/foo/bar/@quux), though I can't see any way to exploit it beyond potentially hiding URL contents in logs. Was going to file, but figured I should pop in here first to see if I'm missing something.
    Jelani Thompson
    @JelaniThompson
    Hey there! I'm making a database with nano currently
    The current approach I'm taking with making user accounts is to create a new document in the users database
    I have two special fields called "username" and "password"
    How can I make it so that the password isn't stored as plain text?
    Don't think it's safe that admins can view passwords right out in the open there lol
    KSV
    @vicmania2007
    is there a way to find and modify a document? Like this mongo equivalent http://stackoverflow.com/questions/6997835/how-does-mongodb-deal-with-concurent-updates ???
    Dominique Sandoz
    @streunerlein
    @vicmania2007 I do not quite understand your question - "find" works by Views, "modify" by regular HTTP request. "Concurrency" has been built into CouchDB 2.0 when used in a clustered environment.
    (ok, last sentence is confusing: "Concurrency" is generally solved by CouchDBs Conflict Management, there is no locking, but there is a "relaxed" handling of conflicts)
    @JelaniThompson CouchDB salts and hashes user passwords, so you enter them in plaintext but they will not get stored in plaintext (but hashed).
    KSV
    @vicmania2007
    @streunerlein my question was how you will find a document and update it. looks like we have to use find method to find the document and update it using db
    Db.insert
    Nevermind I got the solution.
    Thanks @streunerlein
    Dominique Sandoz
    @streunerlein
    @vicmania2007 Yeah, because of CouchDBs architecture, you cannot really "find" documents like you would in other DBs. You find it by filtering a View that contains the document.
    Alright, good luck
    Joe
    @foxjazz
    triing to test couchdb with postman
    curl works, but not sure why this doesn't
    Jean-Marcel Belmont
    @jbelmont
    hello all
    I have a question about using docker with nano library
    const nano = require('nano')('http://db:5984/');
    I am curious about the right way to invoke nano with docker
    I had this before const nano = require('nano')('http://127.0.0.1:5984/');
    I have a Dockerfile and docker-compose.yml
    tanujkhurana
    @tanujkhurana
    Hi, i want to document from couchdb and document have attachment. i want to get the document with attachment. i am not be able to get attachment.
    Basheer A Radman
    @ba2015sheer_twitter
    OK
    Kevin Bai
    @KevinBaiSg
    Hi, I want to create a database user nano.db.create, but it return a error 500