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 – indexing related documents


You will create the Cities_RelatedCountry index which will implement the LoadDocuement() method. Then you will query this index while running the RavenDB_Ch06 project using the Management Studio.

  1. Open the RavenDB_Ch06 project in Visual Studio.

  2. Add a new class and name it Cities_RelatedCountry.

  3. Complete the Cities_RelatedCountry class definition using the following code snippet:

  4. Add the index's Map function within the class constructor using the following code snippet:

  5. Add the following code snippet to the Main() method:

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

What just happened?

You just learned how to index related documents in RavenDB. In order to implement this feature, you called the LoadDocument() method within the Cities_RelatedCountry index's Map function.

The index's Map function defines three fields: Name, Population which will hold values from the City document, and CountryName which will hold information from the Country document....

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}