realm-dotnet icon indicating copy to clipboard operation
realm-dotnet copied to clipboard

Support queries for arrays of primitives

Open RealmBot opened this issue 4 years ago • 8 comments

RealmBot avatar May 05 '20 18:05 RealmBot

Hi guys, is there any estimate on when support for querying primitive arrays will make it into the .net library?

cmcnicholas avatar Feb 03 '21 10:02 cmcnicholas

Not yet - this is something that the Core team is currently working on and we hope to pick it up shortly after they release it.

nirinchev avatar Feb 03 '21 11:02 nirinchev

Not yet - this is something that the Core team is currently working on and we hope to pick it up shortly after they release it.

thanks for the quick reply, just so I can fully understand is this functionality possible if not using the linq functions? e.g. if I was to manually Filter with a predicate.

cmcnicholas avatar Feb 03 '21 11:02 cmcnicholas

Using the Filter extension method and providing a string predicate should work, but we don't have tests for it in the .NET SDK. We should definitely add some though - no need to tie those to proper LINQ support.

nirinchev avatar Feb 03 '21 13:02 nirinchev

Using the Filter extension method and providing a string predicate should work, but we don't have tests for it in the .NET SDK. We should definitely add some though - no need to tie those to proper LINQ support.

my non-extensive tests today show that it does work which is great as we already sidestepping the LINQ support to do direct queries, we found a few cases where we needed more granular control. Thanks for the information 👍

cmcnicholas avatar Feb 03 '21 13:02 cmcnicholas

I couldn't get this to work with a string predicate query and couldn't find documentation on this feature, any chance of getting an example in the docs please?

jbickerton avatar May 17 '22 08:05 jbickerton

@jbickerton we need to improve this part in our documentation. I agree with you. So, thank you for the feedback. We usually recommend users to borrow the JS query language tutorial. If you have used this resource already and you still can't get the query to work, you could post it on the MongoDB forum to get help from us.

LaPeste avatar May 17 '22 10:05 LaPeste

Thanks for getting back to me with that link, the queries there are working for me. For reference, I am using something like .Filter("ANY Tags CONTAINS 'test'") to query on IList<string> Tags when any tag contains the string "test".

jbickerton avatar May 25 '22 09:05 jbickerton