Fix extra values
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using MongoDB.Bson;
|
||||||
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using Telegram.Bot.Types;
|
using Telegram.Bot.Types;
|
||||||
|
|
||||||
|
|
||||||
namespace mstdnCats.Models
|
namespace mstdnCats.Models
|
||||||
{
|
{
|
||||||
|
[BsonIgnoreExtraElements]
|
||||||
public class Post
|
public class Post
|
||||||
{
|
{
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
|
@@ -14,7 +14,7 @@ public class HandleDbBackup
|
|||||||
{
|
{
|
||||||
logger?.LogInformation("Backup requested");
|
logger?.LogInformation("Backup requested");
|
||||||
|
|
||||||
// Retrieve all posts from DB
|
// Retrieve all posts from DB (Exclude _id field from mongoDB since it is not needed nor implemented in Post model)
|
||||||
var posts = _db.AsQueryable().ToList();
|
var posts = _db.AsQueryable().ToList();
|
||||||
// Retrieve all existing posts in backup DB
|
// Retrieve all existing posts in backup DB
|
||||||
var existingPosts = _bkDb.AsQueryable().ToList();
|
var existingPosts = _bkDb.AsQueryable().ToList();
|
||||||
|
Reference in New Issue
Block a user