Home

.NET CouchDB View Server

This is a view server for the CouchDB document-oriented database. It follows the specifications set out at: http://wiki.apache.org/couchdb/View_server

For more information about CouchDB see: http://couchdb.apache.org/

This project consists of two assemblies: ViewServer and ViewHelpers.

  • ViewServer is a console driver application which can be executed by CouchDB to execute map/reduce operations. The driver accepts one command line argument: the .NET language to accept as input. This should be one of the values supported by the System.CodeDom.Compiler system. By default these are "CSharp", "JScript", and "VB". You can add support for a particular language to CouchDB by adding a line to the [query_servers] section of the local.ini file:
[query_servers]
csharp=/path/to/ViewServer.exe CSharp
vb=/path/to/ViewServer.exe VB
  • ViewHelpers contains some helper classes for building views in .NET languages. The helpers include:
    • A singleton class attribute TheCouchDBView which is applied to the class containing the map or reduce function.
    • Interface declarations IMapFunctor, IReduceFunctor and IReReduceFunctor which must be implemented to support the respective functionality.
    • The singleton class Emitter which implements the Emit function which is used for map operations. See SampleViewFunctions.txt for some quick examples.

The code is dynamically compiled and linked into in-memory assemblies. These assemblies are cached until a 'reset' command is received from CouchDB. As a result, compiling is always a one-time cost.

As a fun side note, using C# as the target language works perfectly well under Mono on Linux. Your milage with other languages may vary.

License

Copyright (C) 2010 Anton Markov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Attributions

This software includes the JSON.NET library, Copyright (c) 2007 James Newton-King See JSON.NET/Readme for license details and where to obtain sources.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.