Hello everyone. I’m on chapter 2. The projection. Did I miss a section on how this is supposed to be done? In SQL I could easily "Select m.movies where m.Countries = “whatever” … I’ve added deleted so much code just trying to get this one thing started, I have nothing worthwhile. It’s sort of my last attempt before I go back to SQL.
I have a collection from the movies collection
var movieCollection = db.GetCollection<Movie>("movies");
I’m assuming I create a filter from this collection to find the countries, but I get errors
Because Countries is already a list in the model.
I’ve done this but it comes back empty
List<string> usa = new List<string>(); usa.Add("USA"); var betterFilter = Builders<Movie>.Filter.Eq(m => m.Countries, usa); //errors out not having a list param here var movieList = await movieCollection.Find<Movie>(betterFilter).ToListAsync();
All just to get a list of countries based on the user selection. I am temporarily choosing USA cause it’s right in the first few documents.
Is there anyone out there who can give me just a little help understanding how to work this? Thanks