UNION query

Hi.

Is there a way to combine the result from 2 doctype in a single query ? I like to search doctype A and search doctype B too, I want to do it in a single query. How to do it ?


thanks for the help.

Yes the Union operator can be used for this purpose - but mind: this is NOT a join !

If you have two documents in a collection, in this case “cruise” and “yacht”, a query like this will return a resultset with all the cruises and yachts that satisfy the criterias:

cruise[yacht/@yachtid=“154”] | yacht[@yachtid=“154”]

Finn