0

First off. I am having trouble finding documentation for how to use ravendb with lucene. I can't seem to find documentation to help me query ravendb in the raven studio. Can anyone point men int he right direction?

So if I have the following document:

{
    "Name": "My Name",
    "object": {
        "ObjectName": "Name of an object"
    },
    "array": [
        {
            "first": "first element"
        },
        {
            "second": "second element"
        }
    ]
}

How can I query ravendb to find all documents that have a "first element" string for the "first" key?

If I do array.count: 2. That will return all documents that where array has a length of 2. However if I want to find arrays where the array has greater than say 4 elements, array.count > 4 does not work.

Any advice would be much appreciated.

Again, can you point me to this elusive documentation. I must be searching for the wrong thing.

Cheers

stacka
  • 63
  • 1
  • 8

1 Answers1

0

The query syntax is documented here: https://ravendb.net/docs/article-page/3.5/csharp/indexes/querying/full-query-syntax

The query you want is:

array,first: "first element"

The comma operation in RavenDB 3.5 is used to nest into an array.

For range queries, you'll need:

 array.Count_Range: [Ix4 TO *]
Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • I was wondering what Ix was but you already answered that too. Cheers Buddy. https://stackoverflow.com/questions/32101801/lucene-net-range-subquery-not-returning-expected-results-ravendb-related – stacka Jan 17 '18 at 03:00