![]() |
VOOZH | about |
dotnet add package Couchbase.Lite.Enterprise --version 4.0.4
NuGet\Install-Package Couchbase.Lite.Enterprise -Version 4.0.4
<PackageReference Include="Couchbase.Lite.Enterprise" Version="4.0.4" />
<PackageVersion Include="Couchbase.Lite.Enterprise" Version="4.0.4" />Directory.Packages.props
<PackageReference Include="Couchbase.Lite.Enterprise" />Project file
paket add Couchbase.Lite.Enterprise --version 4.0.4
#r "nuget: Couchbase.Lite.Enterprise, 4.0.4"
#:package Couchbase.Lite.Enterprise@4.0.4
#addin nuget:?package=Couchbase.Lite.Enterprise&version=4.0.4Install as a Cake Addin
#tool nuget:?package=Couchbase.Lite.Enterprise&version=4.0.4Install as a Cake Tool
Couchbase Lite is a lightweight embedded NoSQL database that has built-in sync to larger backend structures, such as Couchbase Server.
This is the source repo of Couchbase Lite C#. The main supported platforms are .NET 6 Desktop (Linux will run anywhere, but is most tested on Ubuntu), .NET 8 iOS, .NET 8 Android, .NET 8 Mac Catalyst, .NET 8 WinUI, Xamarin iOS, and Xamarin Android.
The following starter code demonstrates the basic concepts of the library:
using System;
using Couchbase.Lite;
using Couchbase.Lite.Query;
using Couchbase.Lite.Sync;
// Get the database (and create it if it doesn't exist)
var database = new Database("mydb");
var collection = database.GetDefaultCollection();
// Create a new document (i.e. a record) in the database
var id = default(string);
using var createdDoc = new MutableDocument();
createdDoc.SetFloat("version", 2.0f)
.SetString("type", "SDK");
// Save it to the database
collection.Save(createdDoc);
id = createdDoc.Id;
// Update a document
using var doc = collection.GetDocument(id);
using var mutableDoc = doc.ToMutable();
createdDoc.SetString("language", "C#");
collection.Save(createdDoc);
using var docAgain = collection.GetDocument(id);
Console.WriteLine($"Document ID :: {docAgain.Id}");
Console.WriteLine($"Learning {docAgain.GetString("language")}");
// Create a query to fetch documents of type SDK
// i.e. SELECT * FROM database WHERE type = "SDK"
using var query = QueryBuilder.Select(SelectResult.All())
.From(DataSource.Collection(collection))
.Where(Expression.Property("type").EqualTo(Expression.String("SDK")));
// Alternatively, using SQL++, with _ referring to the database
using var sqlppQuery = collection.CreateQuery("SELECT * FROM _ WHERE type = 'SDK'");
// Run the query
var result = query.Execute();
Console.WriteLine($"Number of rows :: {result.AllResults().Count}");
// Create replicator to push and pull changes to and from the cloud
var targetEndpoint = new URLEndpoint(new Uri("ws://localhost:4984/getting-started-db"));
var replConfig = new ReplicatorConfiguration(targetEndpoint);
replConfig.AddCollection(database.GetDefaultCollection());
// Add authentication
replConfig.Authenticator = new BasicAuthenticator("john", "pass");
// Create replicator
var replicator = new Replicator(replConfig);
replicator.AddChangeListener((sender, args) =>
{
if (args.Status.Error != null) {
Console.WriteLine($"Error :: {args.Status.Error}");
}
});
replicator.Start();
// Later, stop and dispose the replicator *before* closing/disposing the database
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. net9.0-android net9.0-android was computed. net9.0-android35.0 net9.0-android35.0 is compatible. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-ios18.0 net9.0-ios18.0 is compatible. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net9.0-windows10.0.19041 net9.0-windows10.0.19041 is compatible. net10.0 net10.0 was computed. 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 Framework | net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
This package is not used by any NuGet packages.
Showing the top 1 popular GitHub repositories that depend on Couchbase.Lite.Enterprise:
| Repository | Stars |
|---|---|
|
couchbase/couchbase-lite-net
A lightweight, document-oriented (NoSQL), syncable database engine for .NET
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 4.0.4 | 489 | 5/22/2026 | |
| 4.0.3 | 2,605 | 2/23/2026 | |
| 4.0.2 | 10,774 | 12/17/2025 | |
| 4.0.0 | 4,753 | 11/24/2025 | |
| 3.2.6 | 889 | 5/21/2026 | |
| 3.2.5 | 4,901 | 4/2/2026 | |
| 3.2.4 | 83,375 | 6/12/2025 | |
| 3.2.3 | 1,898 | 4/30/2025 | |
| 3.2.2 | 9,208 | 3/14/2025 | |
| 3.2.1 | 99,282 | 11/13/2024 | |
| 3.2.0 | 14,059 | 8/30/2024 | |
| 3.2.0-beta.2 | 553 | 5/16/2024 | |
| 3.1.10 | 414 | 11/25/2024 | 3.1.10 is deprecated because it is no longer maintained. |
| 3.1.9 | 5,588 | 8/9/2024 | 3.1.9 is deprecated because it is no longer maintained. |
| 3.1.7 | 25,285 | 5/1/2024 | 3.1.7 is deprecated because it is no longer maintained. |
| 3.1.6 | 23,816 | 3/6/2024 | 3.1.6 is deprecated because it is no longer maintained. |
| 3.1.3 | 12,758 | 11/16/2023 | 3.1.3 is deprecated because it is no longer maintained. |
| 3.1.1 | 61,407 | 7/18/2023 | 3.1.1 is deprecated because it is no longer maintained. |
| 3.0.15 | 1,796 | 11/6/2023 | 3.0.15 is deprecated because it is no longer maintained. |
| 3.0.12 | 27,482 | 6/26/2023 | 3.0.12 is deprecated because it is no longer maintained. |