Code Monkey home page Code Monkey logo

cornercouch's People

Contributors

alexkunin avatar bryant1410 avatar eddelplus avatar ejeklint avatar kravietz avatar reactiveraven avatar simonmd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cornercouch's Issues

Please add a package.json

This would be convenient for use with npm - currently with no package.json, I can't install CornerCouch even direct from the git repository (which npm supports only if there is a package.json).

There is a workaround using napa which I'm about to try, but a package.json should be simple to create using npm init.

Of course, submitting the resulting CornerCouch package to the npm repository would make it even more convenient to use!

Thanks.

Docs from querys

Hi,

is it possible to have the "save" function on the returning docs from the query function:

$scope.gbookdb.query("app", "utc_only", { include_docs: true, descending: true, limit: 8 });

My goal is to update docs that i have from the query without having to get the doc again by the Id to save it to database. I don't know if I can do this in some way, but i couldn't find it.

Thank you.

Know if a db is processing a request.

I really like the "queryNext()" feature, but it would be great if there was a boolean field, say "processingQueryNext", that would set to true when queryNext() is called and to false when the answer returns.

This would be very useful, for example, to set the "next" button's text to "loading..." during the process.

How to create a _view

Not an issue, really a question - how do I create a custom view? e.g.

function(employee, meta) {
     if (employee.pin == appPinCode)
    {
        emit(employee.firstName,employee.lastName);
    }
}

"queryMore" in addition to "queryNext"

this will be useful when instead of a paging system you use "infinite scrolling".
Just use:

ng-repeat="row in db.rows"

to display the whole accumulated list of rows.

Documentation: CORS with Iris Couch

Had some hickups to get CORS running properly on Iris Couch.

The GUI tools didn't cut it and this set of commands did the trick:

curl -X PUT http://username:[email protected]/_config/httpd/enable_cors -d '"true"'
curl -X PUT http://username:[email protected]/_config/cors/origins -d '"*"' 
curl -X PUT http://username:[email protected]/_config/cors/credentials -d '"true"'
curl -X PUT http://username:[email protected]/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT http://username:[email protected]/_config/cors/headers -d '"accept, authorization, content-type, origin"'
curl -XPOST -HContent-Type:application/json https://username:[email protected]/_restart

Might be handy to add to the wiki somewhere.

adding users to _users table

is this possible with CornerCouch? I would like to PUT this sample object {"_id": "org.couchdb.user:wubble","name": "wubble","roles": [],"type": "user","password": "tubble"} and create new user

Can't POST to CouchDB through HTTP proxy

Hi,
I'm using CouchDB through an HTTP proxy '/docs' on the backend.
Everything works fine for reads when I use:
$scope.server = cornercouch('/docs','GET');
But I want to use the doc.save() method using POST & PUT.
when I use:
$scope.server = cornercouch('/docs','POST');
It doesn't send the data using Content-Type: 'application/json'
and I get a server error.
I'm using a django backend.
I tried to work around this using:
$http.defaults.headers.post['Content-Type'] = 'application/json';
but no avail
Not even sure you're using $http
Can you tell me how to get around this problem?

Recomended way to use an update function

Since all requests towards the couchdb server are made using jsonp, no PUT/POST. So my question is is there any way to call an update function using cornercouch if the database is on a different domain than the app?

CouchDB callback

Hi,

first of all this project is really impressive.

I replicated your database in https://vbrajon.iriscouch.com/gbook1/_design/app/guestbook.html and this is working.

BUT, when i request my iriscouch database in a local development environment, I get an "Uncaught SyntaxError: Unexpected token : " at line 1.

This is probably due to the custom response that your couchdb server is serving when you specify the callback parameter (needed by the angular $http service) :

curl -vX GET http://eddelplus.iriscouch.com/gbook1/_all_docs?callback=testcallback

Then the response is :

/* CouchDB */testcallback({"total_rows":22...);

Or, by default my response is :

{"total_rows":16...}

Here is my code requesting both database, your db is working and mine don't :

// YOUR DATABASE
$scope.server = cornercouch('http://eddelplus.iriscouch.com');
$scope.gbookdb = $scope.server.getDB('gbook1');
$scope.gbookdb.queryAll();

// MY DATABASE
$scope.server = cornercouch('http://vbrajon.iriscouch.com');
$scope.gbookdb = $scope.server.getDB('gbook1');
$scope.gbookdb.queryAll();

Have you specified any view functions or specific configuration in CouchDB ?

Have you any clue to return the right response (wrap content by callback();) ?

Thank you in advance !

Changes Feed?

Is there a changes feed in this bridge I can subscribe to?

Get database automatically

Hello,

thank you very much. CornerCouch makes it very easy to access CouchDB from AngularJS.
However, I have a question regarding $scope.server.getDB('dbname'):
I'm using it within a CouchApp. I would guess that I can skip mentioning the dbname explicitly, as I want to use the same database which servers the CouchApp.
Do I have to parse the URL by hand to avoid mentioning the dbname explicitly in the App?

Any hints would be appreciated.

Sven

encodeUri brutally replaces encoded slashes

The encodeUri(base, part1, part2) function does not permit document-ids with slashes in them, like example/12345 since it does a general uri.replace('%2F', '/'); before returning.

.getDoc() isn't working

I get the following error when I try to call db_obj.getDoc(id):

Uncaught SyntaxError: Unexpected token :

I am able to get the expected document object if I create a new document using .newDoc(), but then if I take that object's _id and use it as the argument for .getDoc() then I get the same error.

doc = database.newDoc();
doc.save();

here is my code

$scope.server = server = cornercouch("http://127.0.0.1:5984");
    database = $scope.server.getDB("rbma_articles");
    console.log("database: ", database)

    $scope.getDoc = function() {
        //hardcoded ID
        id = "8760e498a7d8e963187653179000e65f"
        doc = database.getDoc(id)
    }

note: I am using globals so I can access the objects from the console.

Has anyone else run into this issue/is there something I'm doing wrong here or is this a bug?

Need to Add information regarding enabling JSONP on couchdb.

I believe you should provide some information regarding enabling JSONP on couchdb. So that the JSONP call made by user should not get error out if server returns JSON data.
Or we should put some console message to make user aware that the server is sending JSON data and he/she is trying to read JSONP data..

bower install?

Just tried bower install angular-cornercouch --save with no luck. Any thoughts?

Add docs on how to handle cookies with the login interface

I am having quite a lot of trouble trying to figure out how to interface with couchdbs cookie authentication using your library. I cannot get the value of the AuthSession unless I am actually logged into futon when I use my app (under the same credentials I use to login to futon)

Querying views

Hi,
I'm just starting to use CornerCouch, and there is something I don't quite understand.

After a query, the resulting rows can be accessed via the db.rows attribute. Therefore, only one request per-database can be made at the same time, which is very unhandy.
As a workaround, I was thinking that the query method could accept a variable as parameter which will hold the result of the query instead of db.

The doc says :

You can get yourself multiple database objects form CornerCouch based on the same database if you need to work with multiple views.

But how do you do that without re-calling getDB ? And isn't it overkill to create two instances of the database just to make two queries ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.