﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Designing a document database: View syntax</title><description>Rafal,
  
look at the next post
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment10</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment10</guid><pubDate>Mon, 16 Mar 2009 13:54:13 GMT</pubDate></item><item><title>Ayende Rahien commented on Designing a document database: View syntax</title><description>Yug,
  
You missed the part about there _being_ no editor?
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment9</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment9</guid><pubDate>Mon, 16 Mar 2009 13:24:33 GMT</pubDate></item><item><title>Rafal commented on Designing a document database: View syntax</title><description>Question: can a view contain more rows than the underlying document database? For example: assume an invoice database (each document is an invoice with buyer's and seller's Tax ID). I want to create index: Tax ID -&gt; #of invoices, where tax id can belong either to buyer or seller. In worst case scenario, unique tax IDs in every invoice, we'll have index with 2N entries. How view syntax would look like?
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment8</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment8</guid><pubDate>Mon, 16 Mar 2009 12:40:24 GMT</pubDate></item><item><title>yug commented on Designing a document database: View syntax</title><description>I'm still not sure of the original syntax. With Intellisense and Resharper  etc isn't the original syntax going give you all sorts of visual issues in the editor? Why not just go with the dictionary syntax and save the hassle? Plus it stops the confusion of appearing to be strongly typed...
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment7</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment7</guid><pubDate>Mon, 16 Mar 2009 12:06:47 GMT</pubDate></item><item><title>Ayende Rahien commented on Designing a document database: View syntax</title><description>Frank,
  
Documents don't have to share schema, though.
  
Trying to express this as interface would lead to a whole bunch of trouble.
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment6</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment6</guid><pubDate>Mon, 16 Mar 2009 10:24:40 GMT</pubDate></item><item><title>Ayende Rahien commented on Designing a document database: View syntax</title><description>Rafal,
  
I intend to support transactions, including over multiple docs in the same batch.
  
No DTC planned.
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment5</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment5</guid><pubDate>Mon, 16 Mar 2009 10:23:38 GMT</pubDate></item><item><title>Frank Quednau commented on Designing a document database: View syntax</title><description>Thanks for clarifying this. I suppose the "document" can carry arbitrary properties definable by some user of your DB. Could this not be expressed as an interface at runtime? ...if one would provide some kind of editor to define the view, i could imagine it possible that, once you have said interface for your document, the first expression could be compilable. Additionally, you know how to fill an empty interface with life (Dynamicproxy2, etc.)?
  
Anyway, let's see what follows on !
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment4</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment4</guid><pubDate>Mon, 16 Mar 2009 10:15:13 GMT</pubDate></item><item><title>Rafal commented on Designing a document database: View syntax</title><description>Ayende, I've got a question about transaction management in your document db. Are you going to support transactions at all? Can they cover updates to multiple documents? What about distributed transactions?
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment3</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment3</guid><pubDate>Mon, 16 Mar 2009 09:59:59 GMT</pubDate></item><item><title>Ayende Rahien commented on Designing a document database: View syntax</title><description>Configurator,
  
1. the code totally ignores the variable type, feel free to put whatever you want there.
  
2. Yes, changing the syntax would be pretty easy, yes.
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment2</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment2</guid><pubDate>Mon, 16 Mar 2009 04:51:42 GMT</pubDate></item><item><title>configurator commented on Designing a document database: View syntax</title><description>Now I finally see what you mean. Here, you're actually using a DSL that looks like C# and compiles to C#.
  
  
Two things come to mind:
  
1. I'm not sure the definition should be "var pagesByTitleAndVersion", but "view pagesByTitleAndVersion". That's because you're not generating a variable but a class, and 'var' is a bit confusing in this syntax.
  
2. Whenever we want any complex check (that is, any check other than == or !=), we'd need to cast the return type. i.e. we'd need an example view to be:
  
  
var oldPages = from doc in docs
  
    where doc.Type == "page"
  
    where (DateTime)doc.CreationTime &gt; DateTime.Now.AddDays(-3);
  
  
or something like that. Any way to easily remove that cast? It would be rather cumbersome on the otherwise elegant syntax you're using.
</description><link>http://ayende.com/3909/designing-a-document-database-view-syntax#comment1</link><guid>http://ayende.com/3909/designing-a-document-database-view-syntax#comment1</guid><pubDate>Mon, 16 Mar 2009 00:58:15 GMT</pubDate></item></channel></rss>