Question: This is my code:

```
        <div class="two-columns">
            <div class="col-half">
                <label for="city">Città</label>
                <input type="text" name="city" class="required">
            </div>
            <div class="col-half">
                <label for="province">Provincia</label><br>
                <select name="province" class="required">
                    <option value="">Seleziona la provincia</option>
                </select>
            </div>
        </div>

```

As you can see I put the "class required" in the dropdown because the user must choose a value. All works fine but I cannot see the alert message if I miss to select an item from the dropdown; the form is not sent, correct, but the alert is not shown. Any hints?

Answer: 
Your query should work just fine assuming that you actually have the `54e328ec537d3d20bbdf2ed5` value included in any `sources` field within any `builds` document.

What I mean is, you can't query the `builds` endpoint for the existence of a document in the `sources` endpoint (you can of course do that at the `sources` endpoint.) But, if you actually store a *builds* document and it references a *sources* document, then you query will work fine because what you are actually asking is "get me all *builds* documents which have a reference to this *sources* document". For example, if you POST a document like this to the `builds` endpoint:

```
{
    "sources": ["54e328ec537d3d20bbdf2ed5"]
    "checkin_id": "A"
}

```

Then this query:

```
http://127.0.0.1:5000/builds?where={"sources":"54e328ec537d3d20bbdf2ed5"}

```

Will return that one document. Of course since you defined `sources` as embeddable you can also do:

```
http://127.0.0.1:5000/builds?where={"sources":"54e328ec537d3d20bbdf2ed5"}&embedded={"sources":1}

```

Which will get you referenced documents embedded along with any matching document, like so:

```
{
    "sources": [{"field1": "hey", "field2":"I'm an embedded source"}]
    "checkin_id": "A"
}

```

Whereas you would get a 'raw' document without the explicit embed. It is probably worth mentioning that you can also enable [predefined embedding](http://python-eve.org/features#predefined-resource-serialization) of referenced resources, so your clients don't have to explicitly request an embed.

Hope this helps.
New to Eve but I have an advance on Nicola's "should work", because my experience is that it does not and as this question is what comes up when looking trying to deal with the frustration of figuring out why...

Debugging this the library got me to the point where Eve automagically decides that something with a signature that looks like "54e328ec537d3d20bbdf2ed5" should be cast to an ObjectId, which is all good. However, then the comparison of type ObjectId:54e328ec537d3d20bbdf2ed5 against type string:54e328ec537d3d20bbdf2ed5 is not an equality so your filter returns no results

The really simple solution is to change checkin\_id to ObjectId. Eve starters can be assured you don't need all the additional decorations, so in the above example just change 'type':'string' to 'type':'objectId' and will be good. Specifically, if you have calling code where this field is defined as a string, you can leave it as it is, the cast will occur within eve as described above and it will just work as expected.

edit - See also eve's schema level "query\_objectid\_as\_string" configuration setting for which upon reading seems to override this behaviour.