diff --git a/Notesnook.API/Controllers/MonographsController.cs b/Notesnook.API/Controllers/MonographsController.cs index 5862962..a91b7b0 100644 --- a/Notesnook.API/Controllers/MonographsController.cs +++ b/Notesnook.API/Controllers/MonographsController.cs @@ -24,6 +24,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using MongoDB.Driver; using Notesnook.API.Models; using Streetwriters.Data.Interfaces; using Streetwriters.Data.Repositories; @@ -99,8 +100,11 @@ namespace Notesnook.API.Controllers var userId = this.User.FindFirstValue("sub"); if (userId == null) return Unauthorized(); - var userMonographs = await Monographs.FindAsync((m) => m.UserId == userId); - return Ok(userMonographs.Select((m) => m.Id)); + var monographs = (await Monographs.Collection.FindAsync(Builders.Filter.Eq("UserId", userId), new FindOptions + { + Projection = Builders.Projection.Include("Id"), + })).ToEnumerable(); + return Ok(monographs.Select((m) => m.Id)); }