zoddy / cushion Goto Github PK
View Code? Open in Web Editor NEWNode.js CouchDB API
Home Page: http://zoddy.github.com/cushion
Node.js CouchDB API
Home Page: http://zoddy.github.com/cushion
According to documentation the callbacks of the load and save commands at document level are called with a Cushion.document.
Unfortunately the document objects are different.
Cushion.Document in save callback:
{ _id: 'test9',
_revision: '1-967a00dff5e02add41819138abb3284d',
_connection:
{ _methodMatch: /^GET|PUT|POST|DELETE|HEAD|COPY$/i,
_options:
{ host: '127.0.0.1',
port: '5984',
username: 'stefan',
password: 'xxxx',
secure: false,
path: '' } },
_database:
{ _name: 'stefanjudis',
_connection:
{ _methodMatch: /^GET|PUT|POST|DELETE|HEAD|COPY$/i,
_options: [Object] } },
_body: {},
_error:
{ noId: 'no document id was set',
noRevision: 'no revision was set',
noFile: 'could not read file' }
}
Cushion.Document in load callback:
{ _id: 'test9',
_revision: '1-967a00dff5e02add41819138abb3284d',
_connection:
{ _methodMatch: /^GET|PUT|POST|DELETE|HEAD|COPY$/i,
_options:
{ host: '127.0.0.1',
port: '5984',
username: 'stefan',
password: 'xxxx',
secure: false,
path: '' } },
_database:
{ _name: 'stefanjudis',
_connection:
{ _methodMatch: /^GET|PUT|POST|DELETE|HEAD|COPY$/i,
_options: [Object] } },
_body: { _id: 'test9' },
_error:
{ noId: 'no document id was set',
noRevision: 'no revision was set',
noFile: 'could not read file' }
}
The document body is empty in first callback, but in my opinion should include at least the _id but rather be completely the same as the load document for correct chaining purposes.
Current behavior:
db.view(
'emails',
'all',
{ key : '[email protected]' }
);
makes request:
[info] [<0.4836.0>] 127.0.0.1 - - GET /foo/_design/emails/_view/all?key=hello%2540stefanjudis.de 400
Desired request:
[info] [<0.8878.0>] 127.0.0.1 - - GET /foo/_design/emails/_view/all?key=%[email protected]%22 200
Thx. ๐
Hello,
I tried to use this lib to setup a couchdb test instance for CI/Travis, but discovered cushion always sends authorization even if I don't specify any. The docs suggest cushion doesn't require auth, so I had to turn on Couch debug logs to figure it out (always sends header 'Authorization',"Basic Og=="
which is a base64-encoded colon).
Otherwise looks like a great lib!
I would like to have https support. Thx. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.