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 1838282
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:27:28+00:00 2026-05-17T06:27:28+00:00

So far, I’ve tried the following: public class Widget { public int Id; public

  • 0

So far, I’ve tried the following:

public class Widget
{
    public int Id;
    public string Name;
}

public static class Main
{
    public static void Main()
    {
        // Initialize store and preload with widgets...

        using (var session = store.OpenSession())
        {
            var widgets = session.Load<Widget>();
            foreach(var widget in widgets)
            {
                Console.WriteLine(widget.Name);
            }
        }
    }
}

I have been able to load all by adding an index and then using that index as a query:

var store = new DocumentStore();
store.DatabaseCommands.PutIndex("AllWidgets", new IndexDefinition<Widget>
{
    Map = widget => from widget in widgets
                   select new { widget }
});

// Back in Main
var widgets = session.Query<Widget>("AllWidgets");
// Do stuff with widgets.

Is there a way to just get all documents of type Widget without having to create an index?

At this point I’m just playing with RavenDB in a sandbox environment. I realize that this is usually not the best approach to fetching data.

  • 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-05-17T06:27:28+00:00Added an answer on May 17, 2026 at 6:27 am

    Yes

    use the DocumentsByName query – this as far as I can work out is not intuitive in the client interface at the moment, but looks something like this:

    documentSession.LuceneQuery<ImageDocument>("Raven/DocumentsByEntityName")
                     .Where("Tag:Widgets")
                     .Take(100)
                     .ToArray();
    

    It helps if you know the HTTP API sometimes 🙂

    NB: Note how it pluralises for you, this is a convention and can be overridden.

    Note: In the unstable fork (so likely to be stable soon, the above can easily be achieved with

    documentSession.Query<ImageDocument>().Take(100).ToArray()
    

    Much nicer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Far as best practices are concerned, which is better: public void SomeMethod(string str) {
so far, I have this: class Foo{ private $plugin_methods = array(); public function registerPlugin($caller,
So far i have the following code, but it doesn't seem to be working,
So far I've got the following regex that matches against regular domains but not
As far as I know, there's no public API to collect touch points/locations at
As far as i know it is not possible to do the following in
So far.. I have this test string: Hello {John|Paul|Cindy}, hows {david}? and my expression
So far I've tried: .navbar-inner { text-shadow: black 0.1em 0.1em 0.2em; } And: .nav
So far I have used the following statements in SQLAlchemy to implement table inheritance
As far as I know, in C++ one can declare the same name multiple

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.