score:0

Accepted answer

thx.

i slove it like this:

var query1  =  query.eq("comments.status", 1)
ienumerable<comment> comments = collection.distinct<comment>("comments", query1).where(x => x.status == 1);

comments .tolist() // <= list of comments with status 1

if someone has a better solution please post it.

thx again,

benjamin

score:2

let's assume you have the following classes that contain the serialized values for your collection:

public class user1
{
    public string id { get; set; }

    public comment[] comments { get; set; }
}

public class comment
{
   public int status { get; set; }
}

then the query should be something like:

var query =
    collection.asqueryable<user1>().selectmany(user => user.comments.where(com=>com.status == 1));

Related Query

More Query from same tag