分析RavenDB的索引功能

jieforest發表於2012-12-14
I am currently teaching a course in RavenDB, and as usual during a course, we keep doing a lot of work that pushes what we do with RavenDB. Usually because we try to come up with new scenarios on the fly and adapting to the questions from the students.

In this case, we were going over the map/reduce stack and we kept coming more and more complex example and how to handle them, and then we got to this scenario.

Given the following class structure:

CODE:

1.1: public class Animal
2.{
3.public string Name { get; set; }
4.public string Species { get; set; }
5.public string Breed { get; set; }
6.}Give me the count of all the species and all the breeds.  That is pretty easy to do, right?  In SQL, you would write it like this:

CODE:

1.SELECT Species, Breed, Count(*) FROM Animals
2.GROUP BY Species, Breed

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-751075/,如需轉載,請註明出處,否則將追究法律責任。

相關文章