Quantcast
Channel: Mobile - Couchbase Forums
Viewing all articles
Browse latest Browse all 1117

Cannot get expression with "IN" operator to work in .Net Lite query

$
0
0

@jda wrote:

I have a data structure where I need to get the result of a query like this (in N1QL):

SELECT * FROM data 
WHERE type='ObservationType' AND "2" in locationtypes

In .Net lite I have this code:

if (!string.IsNullOrEmpty(locationType))
{
       _condition = _condition.And(Expression.String(locationType).In(Expression.Property("locationtypes")));
}

… but I get a: System.NotSupportedException has been thrown. I tried with this as well:

       _condition = _condition.And(Expression.String(locationType).In(Expression.Value(Expression.Property("locationtypes"))));

Same error :frowning:

How can I make the query understand that I want to use the “locationtypes” property?

This is a sample output from the N1QL query:

      "locationtypes": [
        "2"
      ],

… or:

      "locationtypes": [
        "4",
        "5"
      ],

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 1117

Trending Articles