From bcf32beaf8ba322b29f062d6d86b7b1b0bcebe1e Mon Sep 17 00:00:00 2001 From: Matteo Bortolazzo Date: Thu, 20 Oct 2022 01:03:51 +0200 Subject: [PATCH 1/2] Add deleted flag --- CHANGELOG.md | 1 + LATEST_CHANGE.md | 1 + src/CouchDB.Driver/Types/CouchDocument.cs | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fda17bd..fce128b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * **Bulk Delete**: Adds support to replication ([#171](https://github.com/matteobortolazzo/couchdb-net/issues/171)) * **Revision Support**: Support for revisions in add and update ([#170](https://github.com/matteobortolazzo/couchdb-net/pull/170)) +* **Deleted Flag**: Added deleted flag on document ([#154](https://github.com/matteobortolazzo/couchdb-net/pull/154)) ## Bug Fixes diff --git a/LATEST_CHANGE.md b/LATEST_CHANGE.md index 5663c2f..788efe8 100644 --- a/LATEST_CHANGE.md +++ b/LATEST_CHANGE.md @@ -2,6 +2,7 @@ * **Bulk Delete**: Adds support to replication ([#171](https://github.com/matteobortolazzo/couchdb-net/issues/171)) * **Revision Support**: Support for revisions in add and update ([#170](https://github.com/matteobortolazzo/couchdb-net/pull/170)) +* **Deleted Flag**: Added deleted flag on document ([#154](https://github.com/matteobortolazzo/couchdb-net/pull/154)) ## Bug Fixes diff --git a/src/CouchDB.Driver/Types/CouchDocument.cs b/src/CouchDB.Driver/Types/CouchDocument.cs index 1c364c3..edc7571 100644 --- a/src/CouchDB.Driver/Types/CouchDocument.cs +++ b/src/CouchDB.Driver/Types/CouchDocument.cs @@ -38,6 +38,15 @@ protected CouchDocument() [JsonProperty("rev", NullValueHandling = NullValueHandling.Ignore)] private string RevOther { set => Rev = value; } + [JsonIgnore] + public bool Deleted { get; private set; } + [DataMember] + [JsonProperty("_deleted", NullValueHandling = NullValueHandling.Ignore)] + private bool DeletedOther + { + set => Deleted = value; + } + [DataMember] [JsonProperty("_conflicts")] private readonly List _conflicts; From 1fdc43d598da42ecae348337867139271649b16f Mon Sep 17 00:00:00 2001 From: Matteo Bortolazzo Date: Thu, 20 Oct 2022 01:05:02 +0200 Subject: [PATCH 2/2] Add data member to Deleted --- src/CouchDB.Driver/Types/CouchDocument.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CouchDB.Driver/Types/CouchDocument.cs b/src/CouchDB.Driver/Types/CouchDocument.cs index edc7571..73da7c8 100644 --- a/src/CouchDB.Driver/Types/CouchDocument.cs +++ b/src/CouchDB.Driver/Types/CouchDocument.cs @@ -38,6 +38,7 @@ protected CouchDocument() [JsonProperty("rev", NullValueHandling = NullValueHandling.Ignore)] private string RevOther { set => Rev = value; } + [DataMember] [JsonIgnore] public bool Deleted { get; private set; } [DataMember]