Tutorial #008: Retrieving folders and documents from the Bloomreach repository
in Bloomreach XM Tutorials,
by Marnix Kok
last published on 15 August 2022
Let's talk about retrieving folders and documents from the Bloomreach repository using the XIN mods extensions.
Please download the Recipes package at the link below:
The additional test code discussed in the video is as follows:
it("should list some recipes", async () => { const conn = xinmods.connectTo("http://localhost:8080", "admin", "admin"); const {folders} = await conn.listDocuments("/content/documents/recipes"); for (const category of folders) { const {documents: recipes} = await conn.listDocuments(category.path); const titles = recipes.map((recipe) => recipe.document.items.title); console.log("Category: ", category.label); console.log("Recipes: ", titles); console.log("----"); } });