The Aspect-Oriented Data Project 
HomeC  Home
downloadC  Software
teachingC  Classroom
people  People
papers  Papers
Due date:


Your task is to install a NoSQL database using CouchDB and write some queries.


Turnin in the file queries.txt using the turnin page. You may turnin your assignment as many times as you like.


The assignment will be graded for functionality.


The assignment permits you to work in groups of at most two. I will assume that the same groups for the SQL, part 2 assignment. E-mail me if your group has dissolved.

Using CouchDB

Download and configure the software for your system. Then create a database, and within that database a document. To that document add the data in the file data.txt.


A text file, queries.txt, containing solutions in JSON to the following queries. The file should be formatted as follows (values of the fields will vary!).
----Query 1: Count the randomArrayItems
   "_id": "_design/countRandomArrayItems",
   "_rev": "2-b4e0bf693aea17edffd8a05ea80b9989",
   "language": "javascript",
   "views": {
       "countRandomArrayItems": {
           "map": "function(doc) {\n  for (var i in {\n    var person =[i];\n    emit(, 1);\n  }\n}",
           "reduce": "function(keys, values, rereduce) {\n  return values.length;\n}"

----Query 2: Names of people with max age by gender and isActive ...

  1. Count the randomArrayItems.


  2. Name(s) of the person(s) with the maximum age, and their age(s) by gender and whether they are active or not.


  3. A count of the people by tags, that is, count all the people with the given value in the tags array.


  4. The average age of people by company.


  5. The JSON of the lattitude, longitude, and address of each employee that has a lattitude of more than 80.


  6. Names of people and their frineds that start with the letter "J" if they have at least one friend whose name starts with the letter "J".


E-mail questions or comments to or Curtis dot Dyreson at usu dot edu