0

I'm beginner in Mongodb with c#. I use Mongodb Driver C# I want to create a filter with condition is lenght of string=n. I check the function support it but i'm not found.

I have research and i use code below

var filterBuilder = Builders.Filter; var filter = filterBuilder.Eq("this.MyString.length ", lenght);

but it's not working. I need your helps. Thanks all

Dan LE
  • 27
  • 1
  • 7
  • Possible dupe of https://stackoverflow.com/questions/29577713/string-field-value-length-in-mongodb – JohnnyHK Jul 26 '17 at 17:48
  • Is `lenght` a typo of `length`? Check the second argument being passed here: filterBuilder.Eq("this.MyString.length ", **lenght**); – C. Helling Jul 26 '17 at 19:31
  • What exactly do you want to achieve? Do you want to return all documents where a certain field of type string has a particular length? What does your data look like? What is your desired output? – dnickless Jul 26 '17 at 19:42

0 Answers0