![]() |
VOOZH | about |
dotnet add package LiteDB.Queryable --version 10.0.2
NuGet\Install-Package LiteDB.Queryable -Version 10.0.2
<PackageReference Include="LiteDB.Queryable" Version="10.0.2" />
<PackageVersion Include="LiteDB.Queryable" Version="10.0.2" />Directory.Packages.props
<PackageReference Include="LiteDB.Queryable" />Project file
paket add LiteDB.Queryable --version 10.0.2
#r "nuget: LiteDB.Queryable, 10.0.2"
#:package LiteDB.Queryable@10.0.2
#addin nuget:?package=LiteDB.Queryable&version=10.0.2Install as a Cake Addin
#tool nuget:?package=LiteDB.Queryable&version=10.0.2Install as a Cake Tool
An IQueryable wrapper implementation for LiteDB with additional async extensions.
This library allows the use of LINQ extensions methods for querying LiteDB.
The LiteQueryable<T> implementation is a warpper around a ILiteCollection<T>
or a ILiteCollectionAsync<>. The LINQ extenions call are delegated to the
equivalent methods of the LiteDB API.
Add the NuGet package to your project: LiteDB.Queryable
You can then aquire an IQueryable<T> instance using one of the available AsQueryable
extension methods for ILiteCollection<T> or ILiteCollectionAsync<T>. The async
variant is provided by the litedb-async project.
LiteDatabase database = new LiteDatabase("test.db");
ILiteCollection<Person> collection = database.GetCollection<Person>("people");
IQueryable<Person> queryable = collection.AsQueryable();
or
LiteDatabaseAsync database = new LiteDatabaseAsync("test.db");
ILiteCollectionAsync<Person> collection = database.GetCollection<Person>("people");
IQueryable<Person> queryable = collection.AsQueryable();
After that you can use the synchronous LINQ extensions with both variants and the asynchronous ones with the second variant.
You can use the following methods to configure your query. Those methods are available in both variants.
The ThenBy/ThenByDescending methods and multiple OrderBy/OrderByDescending class are not
supported at the moment, because LiteDB doesn't support multiple order exprssions.
LiteDatabase database = new LiteDatabase("test.db");
ILiteCollection<Person> collection = database.GetCollection<Person>("people");
IQueryable<Person> queryable = collection.AsQueryable();
IList<Person> result = queryable
.Where(x => x.Name.StartsWith("T"))
.OrderBy(x => x.Age)
.ToList();
Person result = queryable
.Where(x => x.Age > 35)
.FirstOrDefault();
string result = queryable
.Where(x => x.Age > 35)
.Select(x => x.Name)
.FirstOrDefault();
or
LiteDatabaseAsync database = new LiteDatabaseAsync("test.db");
ILiteCollectionAsync<Person> collection = database.GetCollection<Person>("people");
IQueryable<Person> queryable = collection.AsQueryable();
IList<Person> result = await queryable
.Where(x => x.Name.StartsWith("T"))
.OrderBy(x => x.Age)
.ToListAsync();
Person result = await queryable
.Where(x => x.Age > 35)
.FirstOrDefaultAsync();
string result = await queryable
.Where(x => x.Age > 35)
.Select(x => x.Name)
.FirstOrDefaultAsync();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 3 NuGet packages that depend on LiteDB.Queryable:
| Package | Downloads |
|---|---|
|
TestTestCMS.Repositories.LiteDb
Repositories LiteDB. |
|
|
Magicube.Data.LiteDb
Package Description |
|
|
FluentCMS.Repositories.LiteDb
Repositories LiteDB. |
Showing the top 1 popular GitHub repositories that depend on LiteDB.Queryable:
| Repository | Stars |
|---|---|
|
fluentcms/FluentCMS
ASP.NET Core Blazor Content Management System (CMS)
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 10.0.2 | 954 | 4/21/2026 | |
| 10.0.1 | 237 | 4/13/2026 | |
| 10.0.0 | 2,894 | 12/9/2025 | |
| 9.0.0 | 9,316 | 11/14/2024 | |
| 2.3.3 | 1,170 | 11/1/2024 | |
| 2.3.2 | 4,828 | 7/9/2024 | |
| 2.3.1 | 934 | 6/8/2024 | |
| 2.3.0 | 1,354 | 3/20/2024 | |
| 2.2.2 | 274 | 3/19/2024 | |
| 2.2.1 | 343 | 3/6/2024 | |
| 2.2.0 | 565 | 2/18/2024 | 2.2.0 is deprecated because it has critical bugs. |
| 2.1.0 | 2,314 | 11/24/2023 | 2.1.0 is deprecated because it has critical bugs. |
| 2.0.0 | 557 | 11/16/2023 | 2.0.0 is deprecated because it has critical bugs. |
| 1.0.8 | 292 | 11/12/2023 | 1.0.8 is deprecated because it has critical bugs. |
| 1.0.7 | 1,228 | 7/23/2023 | 1.0.7 is deprecated because it has critical bugs. |
| 1.0.6 | 2,210 | 3/22/2023 | 1.0.6 is deprecated because it has critical bugs. |
| 1.0.5 | 463 | 3/16/2023 | 1.0.5 is deprecated because it has critical bugs. |
| 1.0.4 | 604 | 2/24/2023 | 1.0.4 is deprecated because it has critical bugs. |
| 1.0.3 | 698 | 1/18/2023 | 1.0.3 is deprecated because it has critical bugs. |
| 1.0.2 | 941 | 12/12/2022 | 1.0.2 is deprecated because it has critical bugs. |