I have collection that contain documents with the following structure
{
id: "doc01",
property1: "",
nextCollection: "doc02"
prevCollection: null
},
{
id: "doc02",
property1: "",
nextCollection: "doc03",
prevCollection: "doc01"
},
{
id: "doc03",
property1: "",
nextCollection: null,
prevCollection: "doc02"
},
The above code contains three documents. What I want to do is to write a N1QL query that gets all documents in the list given doc01 id.
That is I want the return type to be
[
{
id: "doc01",
property1: "",
nextCollection: "doc02"
prevCollection: null
},
{
id: "doc02",
property1: "",
nextCollection: "doc03",
prevCollection: "doc01"
},
{
id: "doc03",
property1: "",
nextCollection: null,
prevCollection: "doc02"
}
]
How to write such query?