Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:48:00+00:00 2026-06-09T08:48:00+00:00

I need some help about Raven DB and its C# API. I want to

  • 0

I need some help about Raven DB and its C# API.
I want to do an “order by” with a Linq query (with the Linq to Raven implementation). To do so I have to create an index to realize this action. My schema is currently normalized, but I want to denormalize it in order to add a custom property in it.

So, I have :

Entity A :

  • Some property
  • The Id of a B entity

In fact, I simply want to order my As by a B property. So I want to denormalize my A to include the B property.

So a scheme evolution is possible with RavenDB, but in order to set the B property in A I have to load the B when converting the A. And it seems impossible according to the documentation.

I don’t want to build a creepy program that will iterate on each A to load Bs but I don’t see another solution.

Any idea ?

Thank you for your time :).
Julien

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:48:01+00:00Added an answer on June 9, 2026 at 8:48 am

    You should not write a creepy program, but a robust migrations project that will hold a bunch of helpful migration scripts. A simple script like the bellow will do the work for you:

    public void LoadAndSaveWithDenormalizedProperty()
    {
        using (var session = store.OpenSession())
        {
            int skip = 0;
            const int take = 24;
            while (true)
            {
                var items = session.Query<ItemA>()
                    .Customize(customization => customization.Include(x => x.ItemBId))
                    .Skip(skip)
                    .Take(take)
                    .ToList();
                skip += items.Count;
    
                foreach (item in items)
                {
                    item.DenormalizedProperty = 
                           session.Load<ItemB>(item.ItemBId).PropertyToDenormalize;
                }
    
                session.SaveChanges();
    
                if (items.Count == 0)
                    break;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help about with Memcache. I have created a class and want to
I need some help about WCF and authorization. Currently I have a client which
I need some help about RegExp in AS3. I have a simple pattern :
I need some help with PHP Class. I have limited knowledge about how it
I'm confused about how DQL works, and really need some help here. I have
I need some help about xsl. I have a date attribute in source xml
I need some informative help about animation. Want to add animation in iPhone Application..
I need some help. I'm not sure about the order on request for mod_rewrite
I need some help on this problem. It is about ASP.NET MVC3. I have
I need some help about JavaScript on iPhone UIWebView ; I have HTML like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.