tags([{ name, value }])
Queries using metadata tags attached to transactions during upload.
Parameters
-[{(name, value)}]
: An array of tag name / value pairs
Search for a single tag name / value pair:
const results = await myQuery.search("irys:transactions").tags([{ name: "Content-Type", values: ["image/png"] }]);
Search for a single tag name with a list of possible values. The search uses OR logic and returns transactions tagged with ANY provided value:
const results = await myQuery
.search("irys:transactions")
.tags([{ name: "Content-Type", values: ["image/png", "image/jpg"] }]);
Search for multiple tags. The search uses AND logic and returns transactions tagged with ALL provided values:
const results = await myQuery.search("irys:transactions").tags([
{ name: "Content-Type", values: ["image/png"] },
{ name: "Application-ID", values: ["myApp"] },
]);
You can also search Arweave by tags:
const results = await myQuery
.search("arweave:transactions")
.tags([{ name: "Content-Type", values: ["image/png", "image/jpg"] }]);