.NET

Introducing Couchbase.Lite.Mapping: A New Nuget Package

Couchbase Lite 2.0 is a powerful NoSQL embedded data store for iOS, Android and .Net Mobile Platforms. Couchbase Lite provides functionality such as database and document CRUD operations, brings powerful Query API with SQL-like semantics and Full-Text-Search (FTS) capabilities.

Couchbase Lite Extensibility

그리고 Couchbase.Lite 그리고 Couchbase.Lite.Enterprise Nuget packages provide a broad array of capabilities for easily creating, configuring, and manipulating the data within Couchbase Lite (카우치베이스 라이트) databases on the platforms that support the Couchbase Lite .NET SDK. While these packages already contain a large amount of functionality out of the box, an enormous benefit of using Nuget packages is the potential for extensibility. The ability to extend existing functionality provides us, as a development community, with an avenue to create and maintain projects that supplement existing Couchbase Lite features.

One example of an opportunity to extend Couchbase Lite is to add the ability to dynamically convert objects to and from MutableDocument objects. Currently, as seen below, each model object property name and value must be added manually to MutableDocument objects through various type-specific methods.

Subsequently, to convert a MutableDocument back into the original object the following must be done.

 

Introducing Couchbase.Lite.Mapping

As you can see, the code for converting an object into a MutableDocument and back again is simple, but as every object must be mapped developers can find themselves writing many similar lines of code. So, it’s with much excitement that Couchbase Labs is introducing a new Nuget package to help decrease the amount of code written to map model objects to and from MutableDocument objects.

Couchbase.Lite.Mapping can be found on Nuget.org, and is a completely open-source project maintained in Couchbase Labs on Github. It is important to note that the Couchbase.Lite.Mapping library is not officially supported by Couchbase, Inc., but is, instead, a community effort. Please give it a try, and let us know what you think!

Also, as this is an ongoing effort, please feel free to contribute by submitting comments, issues, and/or pull-requests.

 

Share this article

Author

Rob Hedgpeth is a Senior Developer Advocate at Couchbase specializing in mobile and IoT technologies. Rob has been developing applications of all flavors for over a decade, but has primarily been focused on the mobile space since 2010. Prior to working at Couchbase Rob worked as a Mobile Architect at Xamarin and Microsoft.

데이터베이스의 확장성을 과거의 일로 남겨두세요

각 스택 추가마다 추가 비용이 발생하고 관리해야 할 항목도 더 많아집니다. 2분 안에 절약할 수 있는 금액을 추산해 보세요.