The answers given by by Jon, Jared, and yshuditelu use query-by-example which is largely unused DB4o querying mechanism, and could potentially be deprecated in the future.
The preferred methods of querying on DB4O for .NET is native queries and LINQ.
// Query for all Pilots using DB4O native query:
var result = db.Query<Pilot>();
Or alternatively using Linq-to-DB4O:
// Query for all Pilots using LINQ
var result = from Pilot p in db
select p;
Both of these work provided you know the type (e.g. Pilot) at compile time. If you don't know the type at compile time, you can instead use a DB4O SODA query:
var query = db.Query();
query.Constrain(someObj.GetType());
var results = query.Execute();
edit Why use LINQ instead of SODA, Query-by-Example (QBE), or Native Query (NQ)? Because LINQ makes it very natural to do query expressions. For example, here's how you'd query for pilots named Michael:
var michaelPilots = from Pilot p in db
where p.Name == "Michael"
select p;
And LINQ is composable, meaning you can do things like this:
var first20MichaelPilots = michaelPilots.Take(20);
And you'll still get an efficient query executed in DB4O when you iterate over the results. Doing the same in SODA or QBE or NQ is ugly at best.