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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:56:56+00:00 2026-05-20T05:56:56+00:00

For db4o, I’m trying to find the LINQ code that generates the following SODA:

  • 0

For db4o, I’m trying to find the LINQ code that generates the following SODA:

    var query = db4o.db.Query();
    query.Descend("Symbol");        
    query.Descend("_symbolGlobal").Constrain("APPLE");
    query.Descend("_date"); // Add a date constraint here.
    IObjectSet result = query.Execute();

All the SODA does is drop down the tree to an end node. For example, if you wanted to select “APPLE” for date “2010-10-18”, it would return “Apples on Thursday”.

Data structure:

Root ----Symbol (APPLE)                
   |          |------Day 1: Date: 2010-10-18, string "Apples on Thursday"
   |          |------Day 2: Date: 2010-10-19, string "Apples on Friday"
   |
   |
   |-----Symbol (PEAR)               
              |------Day 1: Date: 2010-10-18, string "Pears on Thursday"
              |------Day 2: Date: 2010-10-19, string "Pears on Friday"

Here is my first attempt, which doesn’t work as its getting the cross product (i.e. its looking at every possible combination). I can’t use a join, as db4o is an object database and you don’t have access to the ID for each object, like in a RDBMS.

    var stringForDayAndSymbol = from s in db4o.db.Query<Symbol>(a => a.SymbolGlobal == "APPLE")
                          from t in db4o.db.Query<Date>(b => b.Date == new DateTime(2010, 10, 20))
                          select new
                          {
                            s.SymbolGlobal,
                            t.Date,
                            t.Meta
                          };
  • 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-20T05:56:57+00:00Added an answer on May 20, 2026 at 5:56 am

    Do you really directly want to descent into “Symbol” with query.Descend("Symbol");? I guess that you want to constrain for the type ‘Symbol’. I just assume that you meant this:

    var query = db4o.db.Query();
    query.Constrain(typeof(Symbol));        
    query.Descend("_symbolGlobal").Constrain("APPLE");
    query.Descend("_date"); // Add a date constraint here.
    IObjectSet result = query.Execute();
    

    Not 100% sure, but should be something like this:

    // I assume here that the field _symbolGlobal is accessable with the property SymbolGlobal
    // and the field _date is accessable with the property Date
    var result = from Symbol s in db4o.db
                where s.SymbolGlobal == "APPLE"  
                select s.Date;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I didn't find anywhere whether is possible to query from Db4o all objects implementing
I am using DB4O to store my objects. Please find below code to retrieve
DB4O appears to be chocking on a string that has the @ symbol in
It seems that db4o will ignore config parameters where you are trying to index
Does the replication system that comes with DB4O work well? Basically I would like
I'm using db4o in a small project that works great on Android 2.2, 2.3,
I am trying the db4o object databse and so far I quite like what
I'm working with Linq expression trees (from the db4o/Mainsoft/Mono port) on the Compact Framework.
I have a db4o database that was generate by a Java app and I'm
I am developing VAADIN using Db4O for storage. Normally, I love the fact that

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.