I have a Mongo DB table Notes with following structure
Id(autoincrement value)
UserId
Notes(Collection)
And now i need to add one more record into that existing Notes collection. How do i do it in Mongo DB using Mongo DB driver?
In my repository i tried something like following, but its not working
public NoteUser AddNote(string userId, Note note)
{
var filters = Builders<NoteUser>.Filter.Eq(x=>x.UserId, userId);
context.Notes.InsertOne(filter,note);
}
How do i insert a new record to existing collection in Mongo DB table?