Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
RavenDB 2.x Beginner's Guide

You're reading from  RavenDB 2.x Beginner's Guide

Product type Book
Published in Sep 2013
Publisher Packt
ISBN-13 9781783283798
Pages 356 pages
Edition 1st Edition
Languages
Author (1):
Khaled Tannir Khaled Tannir
Profile icon Khaled Tannir

Table of Contents (21) Chapters

RavenDB 2.x Beginner's Guide
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Getting Started with RavenDB RavenDB Management Studio RavenDB.NET Client API RavenDB Indexes and Queries Advanced RavenDB Indexes and Queries Advanced RavenDB Document Capabilities RavenDB Administration Deploying RavenDB Scaling-out RavenDB RavenDB Profiling RavenDB HTTP API Putting It All Together Pop Quiz Answers Index

Time for action – using the TransformResults function


You will create a new index class, then add a Map and TransformResults function. The index definition will contain only one Map function that retrieves the city population. Once the index is created you will execute it in Management Studio and view the result.

  1. Open the RavenDB_CH05 project in Visual Studio.

  2. Add a new class, name it TransformationResult and complete it with the following code snippet:

  3. Add a new class, and name it Cities_ByPopulation and complete it with the following code snippet:

  4. Add the following code snippet to the Main() method in the Program class:

  5. Save all the files, build and run the solution.

  6. In Management Studio, execute the Cities/ByPopulation index and observe the result.

What just happened?

You just created the Cities_ByPopulation index and implemented its Map function and TransformResults functions in order to transform the Map function result and get something different from the original Map result.

We begin by...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}