My document has a property that is of the type List<string>
.
I want to return all documents from a collection where a set of strings match any item from this List<string>
property.
I would like to construct this like the following question, but in C#:
MongoDB find where key equals string from array
I know this is off, but it's my best attempt:
var queryItems = new List<QueryComplete>();
queryItems.Add(Query.EQ("PropertyName", "test"));
var query= Query.Or(queryItems.ToArray());
var qd = new QueryDocument(new BsonDocument { query.ToBsonDocument() });
var result = GetCollection<CollectionName>().FindAs<Type>(qd)