DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Trending

  • Google Becomes A Java Developer's Best Friend: Instantiations Developer Tools Relaunched For Free
  • Conditional Breakpoints: A Guide to Effective Debugging
  • Five Java Books Beginners and Professionals Should Read
  • Cypress Tutorial: A Comprehensive Guide With Examples and Best Practices
  1. DZone
  2. Data Engineering
  3. Data
  4. RavenDB's Scripted Index Results

RavenDB's Scripted Index Results

Oren Eini user avatar by
Oren Eini
·
May. 31, 13 · Interview
Like (0)
Save
Tweet
Share
1.70K Views

Join the DZone community and get the full member experience.

Join For Free

scripted index results (i wish it would have a better name) is a really interesting new feature in ravendb 2.5. as the name implies, it allows you to attach scripts to indexes. those scripts can operate on the results of the indexing.

sounds boring, right? but the options that is opens are nothing but. using scripted index results you can get recursive map/reduce indexes, for example. but we won’t be doing that today. instead, i’ll show how you can enhance entities with additional information from other sources.

our sample database is northwind, and we have defined the following index to get some statistics about our customers:

image

and we can query it like this:

image

however, what we want to do is to be able to embed those values inside the company document, so we won’t have to query for it separately. here is how we can use the new scripted index results bundle to do this:

image

once we have defined that, whenever the index is done, it will run these scripts, and that, in turns, means that this is what our dear alfki looks like:

image

i’ll leave recursive map/reduce as tidbit for my dear readers smile .

Database Document Statistics

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Google Becomes A Java Developer's Best Friend: Instantiations Developer Tools Relaunched For Free
  • Conditional Breakpoints: A Guide to Effective Debugging
  • Five Java Books Beginners and Professionals Should Read
  • Cypress Tutorial: A Comprehensive Guide With Examples and Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: