A short introduction of list and show handling functions in couchdb. Examples are taken from the book "CouchDB mit PHP".
Talk was given at the berlin couchdb meetup (http://berlin.couchdb.org)
Distributed system coordination by zookeeper and introduction to kazoo python...Jimmy Lai
Zookeeper is a coordination tool to let people build distributed systems easier. In this slides, the author summarizes the usage of zookeeper and provides Kazoo Python library as example.
Useful Linux and Unix commands handbookWave Digitech
This article provides practical examples for most frequently used commands in Linux / UNIX. Helpful for Engineers and trainee engineers, Software developers. A handy notes for all Linux & Unix commands.
MySQL 8 introduces support for ANSI SQL recursive queries with common table expressions, a powerful method for working with recursive data references. Until now, MySQL application developers have had to use workarounds for hierarchical data relationships. It's time to write SQL queries in a more standardized way, and be compatible with other brands of SQL implementations. But as always, the bottom line is: how does it perform? This presentation will briefly describe how to use recursive queries, and then test the performance and scalability of those queries against other solutions for hierarchical queries.
These were prepared to teach the module "Emerging Technologies" for the 3rd year Undergraduates of the Asia Pacific Institue of Information Technology, Colombo-2, Sri Lanka (Remotely)
Distributed system coordination by zookeeper and introduction to kazoo python...Jimmy Lai
Zookeeper is a coordination tool to let people build distributed systems easier. In this slides, the author summarizes the usage of zookeeper and provides Kazoo Python library as example.
Useful Linux and Unix commands handbookWave Digitech
This article provides practical examples for most frequently used commands in Linux / UNIX. Helpful for Engineers and trainee engineers, Software developers. A handy notes for all Linux & Unix commands.
MySQL 8 introduces support for ANSI SQL recursive queries with common table expressions, a powerful method for working with recursive data references. Until now, MySQL application developers have had to use workarounds for hierarchical data relationships. It's time to write SQL queries in a more standardized way, and be compatible with other brands of SQL implementations. But as always, the bottom line is: how does it perform? This presentation will briefly describe how to use recursive queries, and then test the performance and scalability of those queries against other solutions for hierarchical queries.
These were prepared to teach the module "Emerging Technologies" for the 3rd year Undergraduates of the Asia Pacific Institue of Information Technology, Colombo-2, Sri Lanka (Remotely)
파이썬 데이터과학 1일차 - 초보자를 위한 데이터분석, 데이터시각화 (이태영)Tae Young Lee
파이썬 데이터과학 - 기초 과정(1일차)
- 데이터분석, 데이터시각화
- jupyter notebook, numpy, pandas, matplotlib, seaborn
2차 과정은 따로 올리겠습니다.
문의 및 제안 : se2n@naver.com
데이터 소스 : https://github.com/sh2orc/datascience
Caching is a technique to save frequently used data into into temporary location. Improves application performance. Reduce a lot of server resources at peak times.
** Linux Admin Certification Training: https://www.edureka.co/linux-admin **
This "Shell Scripting Tutorial" PPT gives you an extensive explanation about Shell Scripting in Linux. It covers the essential concepts such as using variables, basic operators, loops & functions.
It also gives you an insight by scaling down some real-time scenarios and demonstrating them using the virtual machine.
Getting started with Linux
Command Line Essentials
Shell Script Basics
Using Variables
Basic Operations
Shell Loops
Shell Functions
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Tree-like data relationships are common, but working with trees in SQL usually requires awkward recursive queries. This talk describes alternative solutions in SQL, including:
- Adjacency List
- Path Enumeration
- Nested Sets
- Closure Table
Code examples will show using these designs in PHP, and offer guidelines for choosing one design over another.
This Edureka "Node.js Express tutorial" will help you to learn the Node.js express fundamentals with examples. Express.js is flexible and minimal node.js web application framework that provides robust set of features to develop mobile and web applications. It facilitates the rapid development of node.js applications. Below are the topics covered in this tutorial:
1) Why Express.js?
2) What is Express.js?
3) Express Installation
4) Express Routes
5) Express Middlewares
PHP unserialization vulnerabilities: What are we missing?Sam Thomas
Video at: https://www.youtube.com/watch?v=PqsudKzs79c
An introduction to PHP unserialization vulnerabilities, with some practical tips on methodology. Based around three new exploits for old vulnerabilities (CVE-2011-4962, CVE-2013-1453, CVE-2013-4338).
PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. As of January 2013, PHP was installed on more than 240 million websites (39% of those sampled) and 2.1 million web servers.[4] Originally created by Rasmus Lerdorf in 1994,[5] the reference implementation of PHP (powered by the Zend Engine) is now produced by The PHP Group.[6] While PHP originally stood for Personal Home Page,[5] it now stands for PHP: Hypertext Preprocessor, which is a recursive backronym
Trends and future of C++: Evolving a systems language for performance - by Bj...devstonez
Bjarne Stroustrup presentation at Universidad Carlos III de Madrid, march 18 2011 on :
- The design of C++0x
- C++: Machine model and resource management
Advanced PHP and MySQL : PHP/MySQL Functions, Integrating web forms and databases, Displaying queries in tables, Building Forms from queries, String and Regular Expressions, Sessions, Cookies and HTTP, E-Mail
MongoDB Days Silicon Valley: Data Analysis and MapReduce with MongoDBMongoDB
Presented by Alexander Hendorf, Königsweg
Experience level: Deep dive
The MongoDB aggregation framework provides a means to calculate aggregated values without having to use map-reduce. While map-reduce is powerful, it is often more difficult than necessary for many simple aggregation tasks, such as totaling or averaging field values. In this talk, I will showcase how to use the built-in data-aggregation-pipelines for averages, summation, grouping, reshaping. You will learn how to work with documents, sub-documents, grouping by year, month, day and more.
파이썬 데이터과학 1일차 - 초보자를 위한 데이터분석, 데이터시각화 (이태영)Tae Young Lee
파이썬 데이터과학 - 기초 과정(1일차)
- 데이터분석, 데이터시각화
- jupyter notebook, numpy, pandas, matplotlib, seaborn
2차 과정은 따로 올리겠습니다.
문의 및 제안 : se2n@naver.com
데이터 소스 : https://github.com/sh2orc/datascience
Caching is a technique to save frequently used data into into temporary location. Improves application performance. Reduce a lot of server resources at peak times.
** Linux Admin Certification Training: https://www.edureka.co/linux-admin **
This "Shell Scripting Tutorial" PPT gives you an extensive explanation about Shell Scripting in Linux. It covers the essential concepts such as using variables, basic operators, loops & functions.
It also gives you an insight by scaling down some real-time scenarios and demonstrating them using the virtual machine.
Getting started with Linux
Command Line Essentials
Shell Script Basics
Using Variables
Basic Operations
Shell Loops
Shell Functions
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Tree-like data relationships are common, but working with trees in SQL usually requires awkward recursive queries. This talk describes alternative solutions in SQL, including:
- Adjacency List
- Path Enumeration
- Nested Sets
- Closure Table
Code examples will show using these designs in PHP, and offer guidelines for choosing one design over another.
This Edureka "Node.js Express tutorial" will help you to learn the Node.js express fundamentals with examples. Express.js is flexible and minimal node.js web application framework that provides robust set of features to develop mobile and web applications. It facilitates the rapid development of node.js applications. Below are the topics covered in this tutorial:
1) Why Express.js?
2) What is Express.js?
3) Express Installation
4) Express Routes
5) Express Middlewares
PHP unserialization vulnerabilities: What are we missing?Sam Thomas
Video at: https://www.youtube.com/watch?v=PqsudKzs79c
An introduction to PHP unserialization vulnerabilities, with some practical tips on methodology. Based around three new exploits for old vulnerabilities (CVE-2011-4962, CVE-2013-1453, CVE-2013-4338).
PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. As of January 2013, PHP was installed on more than 240 million websites (39% of those sampled) and 2.1 million web servers.[4] Originally created by Rasmus Lerdorf in 1994,[5] the reference implementation of PHP (powered by the Zend Engine) is now produced by The PHP Group.[6] While PHP originally stood for Personal Home Page,[5] it now stands for PHP: Hypertext Preprocessor, which is a recursive backronym
Trends and future of C++: Evolving a systems language for performance - by Bj...devstonez
Bjarne Stroustrup presentation at Universidad Carlos III de Madrid, march 18 2011 on :
- The design of C++0x
- C++: Machine model and resource management
Advanced PHP and MySQL : PHP/MySQL Functions, Integrating web forms and databases, Displaying queries in tables, Building Forms from queries, String and Regular Expressions, Sessions, Cookies and HTTP, E-Mail
MongoDB Days Silicon Valley: Data Analysis and MapReduce with MongoDBMongoDB
Presented by Alexander Hendorf, Königsweg
Experience level: Deep dive
The MongoDB aggregation framework provides a means to calculate aggregated values without having to use map-reduce. While map-reduce is powerful, it is often more difficult than necessary for many simple aggregation tasks, such as totaling or averaging field values. In this talk, I will showcase how to use the built-in data-aggregation-pipelines for averages, summation, grouping, reshaping. You will learn how to work with documents, sub-documents, grouping by year, month, day and more.
How to Make Awesome SlideShares: Tips & TricksSlideShare
Turbocharge your online presence with SlideShare. We provide the best tips and tricks for succeeding on SlideShare. Get ideas for what to upload, tips for designing your deck and more.
CosmosDB service is a NoSQL is a globally distributed, multi-model database database service designed for scalable and high performance modern applications. CosmosDB is delivered as a fully managed service with an enterprise grade SLA. It supports querying of documents using a familiar SQL over hierarchical JSON documents. Azure Cosmos DB is a superset of the DocumentDB service. It allows you to store and query noSQL data, regardless of schema. In this presentation, you will learn: • How to get started with DocumentDB you provision a new database account. • How to index documents • How to create applications using CosmosDb (using REST API or programming libraries for several popular language) • Best practices designing applications with CosmosDB • Best practices creating queries.
Introducing the Eve REST API Framework.
FOSDEM 2014, Brussels
PyCon Sweden 2014, Stockholm
PyCon Italy 2014, Florence
Python Meetup, Helsinki
EuroPython 2014, Berlin
Presented to the LA Hacker News meetup on Apache CouchDB. Covers basics on RESTful principles, CRUD operations, views, MVCC, and performance. 30 minutes with Q&A.
What do you mean, Backwards Compatibility?Trisha Gee
Lessons learnt developing the new Java driver for MongoDB. This is a totally different version of my backwards compatibility talk, delivered at JFokus.
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...MongoDB
Este es el cuarto seminario web de la serie Conceptos básicos, en la que se realiza una introducción a la base de datos MongoDB. Este seminario se ve en la compatibilidad con índices de texto libre y geoespaciales.
Media owners are turning to MongoDB to drive social interaction with their published content. The way customers consume information has changed and passive communication is no longer enough. They want to comment, share and engage with publishers and their community through a range of media types and via multiple channels whenever and wherever they are. There are serious challenges with taking this semi-structured and unstructured data and making it work in a traditional relational database. This webinar looks at how MongoDB’s schemaless design and document orientation gives organisation’s like the Guardian the flexibility to aggregate social content and scale out.
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB
Christian Brensing, Senior Developer, State of Bavaria
The Bavarian government runs a document template application (RTF or ODF with Groovy, Python, Ruby or Tcl as scripting language) serving different government offices. Having complex and hierarchical data structures to organize the templates, MongoDB was selected to replace the Oracle-based persistence layer. In this talk you will hear about the improvements we have achieved with the migration to MongoDB, problems we had to solve underway and unit testing of the persistence layer in order to keep our quality level.
A presentation by Aicha Khabil (Responsable IT à l'université Alger 3) done during the 11th edition of Algiers Tech Meetup on October 8th 2016, at Djezzy Training Center (Algiers)
CouchApps are web applications built using CouchDB, JavaScript, and HTML5. CouchDB is a document-oriented database that stores JSON documents, has a RESTful HTTP API, and is queried using map/reduce views. This talk will answer your basic questions about CouchDB, but will focus on building CouchApps and related tools.
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Comsysto Reply GmbH
Bavarian government runs a document template application (RTF or ODF with Groovy, Python, Ruby or Tcl as scripting language) serving different government offices. Having complex and hierarchical data structures to organize the templates, MongoDB was selected to replace the Oracle-based persistence layer. This presentation is about the improvements they have achieved with the migration to MongoDB, problems they had to solve underway and unit testing of the persistence layer in order to keep their quality level. Presentation slides by Christian Brensing, Senior Developer at Rechenzentrum Süd, shown at Munich MongoDB User Group Meetup on 18th September 2012
In this lecture we analyze document oriented databases. In particular we consider why there are the first approach to nosql and what are the main features. Then, we analyze as example MongoDB. We consider the data model, CRUD operations, write concerns, scaling (replication and sharding).
Finally we presents other document oriented database and when to use or not document oriented databases.
Similar to Couchdb List and Show Introduction (20)
Recruiting in the Digital Age: A Social Media MasterclassLuanWise
In this masterclass, presented at the Global HR Summit on 5th June 2024, Luan Wise explored the essential features of social media platforms that support talent acquisition, including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok.
3.0 Project 2_ Developing My Brand Identity Kit.pptxtanyjahb
A personal brand exploration presentation summarizes an individual's unique qualities and goals, covering strengths, values, passions, and target audience. It helps individuals understand what makes them stand out, their desired image, and how they aim to achieve it.
Premium MEAN Stack Development Solutions for Modern BusinessesSynapseIndia
Stay ahead of the curve with our premium MEAN Stack Development Solutions. Our expert developers utilize MongoDB, Express.js, AngularJS, and Node.js to create modern and responsive web applications. Trust us for cutting-edge solutions that drive your business growth and success.
Know more: https://www.synapseindia.com/technology/mean-stack-development-company.html
Event Report - SAP Sapphire 2024 Orlando - lots of innovation and old challengesHolger Mueller
Holger Mueller of Constellation Research shares his key takeaways from SAP's Sapphire confernece, held in Orlando, June 3rd till 5th 2024, in the Orange Convention Center.
Company Valuation webinar series - Tuesday, 4 June 2024FelixPerez547899
This session provided an update as to the latest valuation data in the UK and then delved into a discussion on the upcoming election and the impacts on valuation. We finished, as always with a Q&A
Discover the innovative and creative projects that highlight my journey throu...dylandmeas
Discover the innovative and creative projects that highlight my journey through Full Sail University. Below, you’ll find a collection of my work showcasing my skills and expertise in digital marketing, event planning, and media production.
2. Who am I
Oliver Kurowski
Degree in Computer Science Beuth School of applied Sciences Berlin
First Computer: Apple II 1983
Since 2003: kw automotive GmbH
Write articles in Magazines
2012: Book „CouchDB mit PHP“ (www.CouchDBmitPHP.de)
Twitter: @okurow
Mail: oliver@thinkcouchdb.com
Oliver Kurowski, @okurow
4. Transformation Functions
Documents are JSON objects
Results of views are also JSON objects
CouchDB can transfrom those JSON Objects on server side.
Shows: Transformation for documents
Lists: Transformation for views
Shows and lists are performed during request, results are not stored (like views).
Oliver Kurowski, @okurow
10. Shows:Transform Documents I
Data document (JSON): Show function in a design doc:
{ “shows“: {
“_id“: “1“, “toHTML“:“function(doc,req) {
“make“: “Audi“, var outS=‘‘;
“model“: “A3“, outS=‘<b>‘+doc.maker+‘ ‘+doc.model+‘</b><br>`;
“year“: 2000, outS+=‘Year of Prod.: ‘+doc.year+‘<br>‘;
“price“: 5.400 outS+=‘Price: ‘+doc.price;
} return outS; }“
}
Result of _show/toHTML/1 :
Audi A3
Year of Prod.: 2000
Price: 5.400
Oliver Kurowski, @okurow
11. Shows:Transform Documents II
Data document (JSON):
{
“_id“: “1“,
“author“: “Oliver Kurowski“,
“headline“: “CouchDB is great“,
“body“: “CouchDb is a great database for schemeless data“ ,
“comments“: [ {“name“: “John“, “text“: “Yes, it really is“},
{“name“: “Jane“, “text“: “What about couchbase?“} ]
}
“shows“: {
“headline“:“function(doc,req) {
var comments=0;
if (doc.comments) { comments=doc.comments.length };
var outS=‘<b>‘ + doc.headline + ‘</b> (‘ + comments + ‘ comments)`;
return outS; }“,
“detail“:“function(doc,req) {
var outS=‘<b>‘ + doc.headline + ‘</b><br>`;
outS+= doc.body + ‘<br>`;
if (doc.comments && doc.comments.length>0) {
outS+= ‘comments:<br>`;
for (var curComment in doc.comments) {
outS+=doc.comments[curComment].name+‘:<br>`;
outS+=doc.comments[curComment].text+‘<br>`;
}
}
return outS; }“
}
Oliver Kurowski, @okurow
12. Shows:Transform Documents II
Data document (JSON):
{
“_id“: “1“,
“author“: “Oliver Kurowski“,
“headline“: “CouchDB is great“,
“body“: “CouchDb is a great database for schemeless data“ ,
“comments“: [ {“name“: “John“, “text“: “Yes, it really is“},
{“name“: “Jane“, “text“: “What about couchbase?“} ]
}
“shows“: {
“headline“:“function(doc,req) {
var comments=0;
if (doc.comments) { comments=doc.comments.length };
var outS=‘<b>‘ + doc.headline + ‘</b> (‘ + comments + ‘ comments)`;
return outS; }“,
“detail“:“function(doc,req) {
var outS=‘<b>‘ + doc.headline + ‘</b><br>`;
outS+= doc.body + ‘<br>`;
if (doc.comments && doc.comments.length>0) {
outS+= ‘comments:<br>`;
for (var curComment in doc.comments) {
outS+=doc.comments[curComment].name+‘:<br>`;
outS+=doc.comments[curComment].text+‘<br>`;
}
}
return outS; }“
}
Oliver Kurowski, @okurow
13. Shows:Transform Documents II
Data document (JSON):
{
“_id“: “1“,
“author“: “Oliver Kurowski“,
“headline“: “CouchDB is great“,
“body“: “CouchDb is a great database for schemeless data“ ,
“comments“: [ {“name“: “John“, “text“: “Yes, it really is“},
{“name“: “Jane“, “text“: “What about couchbase?“} ]
}
“shows“: {
“headline“:“function(doc,req) {
var comments=0;
if (doc.comments) { comments=doc.comments.length };
var outS=‘<b>‘ + doc.headline + ‘</b> (‘ + comments + ‘ comments)`;
return outS; }“,
“detail“:“function(doc,req) {
var outS=‘<b>‘ + doc.headline + ‘</b><br>`;
outS+= doc.body + ‘<br>`;
if (doc.comments && doc.comments.length>0) {
outS+= ‘comments:<br>`;
for (var curComment in doc.comments) {
outS+=doc.comments[curComment].name+‘:<br>`;
outS+=doc.comments[curComment].text+‘<br>`;
}
}
return outS; }“
}
Oliver Kurowski, @okurow
14. Shows:Transform Documents II
Data document (JSON):
{
“_id“: “1“,
“author“: “Oliver Kurowski“,
“headline“: “CouchDB is great“,
“body“: “CouchDb is a great database for schemeless data.“ ,
“comments“: [ {“name“: “John“, “text“: “Yes, it really is“},
{“name“: “Jane“, “text“: “What about couchbase?“} ]
}
“shows“: {
“headline“:“function(doc,req) { Result of _show/headline/1 :
var comments=0; CouchDB is great (2 comments)
if (doc.comments) { comments=doc.comments.length };
var outS=‘<b>‘ + doc.headline + ‘</b> (‘ + comments + ‘ comments)`;
return outS; }“,
“detail“:“function(doc,req) {
var outS=‘<b>‘ + doc.headline + ‘</b><br>`;
outS+= doc.body + ‘<br>`;
if (doc.comments && doc.comments.length>0) {
outS+= ‘<hr>Comments:<br>`;
for (var curComment in doc.comments) {
outS+=doc.comments[curComment].name+‘:<br>`;
outS+=doc.comments[curComment].text+‘<br>`;
}
}
return outS; }“
}
Oliver Kurowski, @okurow
15. Shows:Transform Documents II
Data document (JSON):
{
“_id“: “1“,
“author“: “Oliver Kurowski“,
“headline“: “CouchDB is great“,
“body“: “CouchDb is a great database for schemeless data.“ ,
“comments“: [ {“name“: “John“, “text“: “Yes, it really is“},
{“name“: “Jane“, “text“: “What about couchbase?“} ]
}
“shows“: {
“headline“:“function(doc,req) { Result of _show/headline/1 :
var comments=0; CouchDB is great (2 comments)
if (doc.comments) { comments=doc.comments.length };
var outS=‘<b>‘ + doc.headline + ‘</b> (‘ + comments + ‘ comments)`;
return outS; }“,
“detail“:“function(doc,req) {
var outS=‘<b>‘ + doc.headline + ‘</b><br>`;
Result of _show/detail/1 :
outS+= doc.body + ‘<br>`; CouchDB is great
if (doc.comments && doc.comments.length>0) { CouchDb is a great database for schemeless data.
outS+= ‘<hr>Comments:<br>`;
for (var curComment in doc.comments) { Comments:
outS+=doc.comments[curComment].name+‘:<br>`; John:
outS+=doc.comments[curComment].text+‘<br>`; Yes, it really is
} Jane:
} What about couchbase?
return outS; }“
}
Oliver Kurowski, @okurow
16. The Request Object
Shows and lists can access the Request Object containing:
(the most interesting)
Info: Informations about the Database
Id: called document ID (null, if not given)
requested
_path: The request in parts (divided by /) as Array
headers: Header, sent from the client
userCTX: Information about the user, usefull for access limitations!
query: Parameters of the call
The field req.query allows the use of own parameters that can be used in a
show/list function.
F.e: _show/toHTML/1?showPrice=true
handled in the show function: if(req.query.showPrice==true) { ….}
Oliver Kurowski, @okurow
17. Shows:Talking Parrots
Data documents : Design document :
{ {
“_id“: “lora“, “_id“: “_design/parrot“,
“name“: “Lora LoL“, “shows{
“owner“: “Emily“, "introduce": "function(doc,req) {
“color“: [“red“ , “#ff0000“ ] , var outS='';
“languages“: [ “english“ ] if(doc) { // doc with id in database found
} outS+='<font color='+doc.color[1]+'>'+doc.name
+' belongs to '+doc.owner+'</font>';
{ if(req.query.say) {
“_id“: “polly“, if(doc.languages) {
“name“: “Polly Poll“, outS+=' and says: '+req.query.say;
“owner“: “Ernest“, }else{
“color“: [“blue“ , “#0000ff“ ], outS+='tweet';
“languages“: [ “english“ ] }
} }
} else { // no doc found
if(req.path[5]!=undefined) { // no id given
{ outS+='I dont know '+req.path[5];
“_id“: “agnus“, }else{
“name“: “Agnus Angry“, outS+='which parrot?';
“owner“: “Ernest“, }
“color“: [“grey“ , “#cococo“ ] }
} return outS; }“
}
}
Oliver Kurowski, @okurow
18. Shows: Talking Parrots
http://localhost:5984/parrots/_design/parrot/_show/introduce/
->which parrot?
http://localhost:5984/parrots/_design/parrot/_show/introduce/polly
->Polly Poll belongs to Ernest
http://localhost:5984/parrots/_design/parrot/_show/introduce/pollx
->I dont know pollx
http://localhost:5984/parrots/_design/parrot/_show/introduce/lora?say=Hello
->Lora Loll belongs to Emily and says: Hello
http://localhost:5984/parrots/_design/parrot/_show/introduce/agnus?say=Hello
->Agnus Angry belongs to Ernest tweet
Oliver Kurowski, @okurow
24. List:Transform view results I
Result of a View byPrice: A simple list function:
{"total_rows":5,"offset":0, “lists“: {
"rows":[ “asLI “:“function(head,req) {
{"id":"1","key":5.400,"value":“Audi-A3- start({'code':200,'headers':{'Content-Type':'text/html'}});
2000“}, {"id":"2","key":9.000,"value":“VW-Golf- while(row=getRow()) {
2008“}, {"id":"3","key":12.000,"value":“VW-Polo- send(‘<li>‘+row.value+‘ :‘ +row.key+‘</li>‘);
2010“}, {"id":"4","key":15.000,"value":“VW-Golf- }
2009“}, {"id":"5","key":16.000,"value":“Audi-A4- }“
2009“} ]} }
result from _list/asLi/byPrice :
• Audi-A3-2000 : 5.400
• VW-Golf-2008 : 9.000
• VW-Polo-2010 : 12.000
• VW-Golf-2009 : 15.000
• Audi-A4-2009 : 16.000
- All arguments from a view can also be used in a list call
(startkey, endkey, skip, limit etc)
- Like Shows, you have access to the request Object with all ist possibilities.
Oliver Kurowski, @okurow
25. List:Transform view results II
Different headers can be sent
“lists“: {
“asXML “:“function(head,req) {
start({'code':200,'headers':{'Content-Type':'application/xml'}});
var xmlS=‘<cars>‘;
while(row=getRow()) {
xmlS+=‘<car id=‘ + row.id + ‘>‘+row.value+‘ :‘ +row.key+‘</car>‘);
}
xmlS+=‘</cars>‘;
return xmlS;
}“
}
result from _list/asXML/byPrice :
<cars>
<car id=‘1‘>Audi-A3-2000 : 5.400</car>
<car id=‘2‘>VW-Golf-2008 : 9.000</car>
<car id=‘3‘ >VW-Polo-2010 : 12.000</car>
<car id=‘4‘>VW-Golf-2009 : 15.000</car>
<car id=‘5‘>Audi-A4-2009 : 16.000</car>
</cars>
Oliver Kurowski, @okurow