const params = {
limit: <int>,
offset: <int>,
forceRefresh: <boolean>,
operator: <string>
}
const query = [
{
prop: <string>,
operator: <string>,
value: <string>
}
]
unomi.profile.query(params, query);
{
"success": <boolean>,
"status": <int>,
"data": {
"list": [<object>]
}
}
const params = {
limit: 10,
offset: 0,
forceRefresh: true,
operator: "and"
}
const query = [
{
prop: "properties.firstName",
operator: "equals",
value: "John"
},
{
prop: "properties.lastName",
operator: "equals",
value: "Doe"
}
]
async function getProfiles() {
try {
const { data: { list } } = await unomi.profile.query(params, query);
list.forEach((profile) => {
console.log(`Hello ${profile.properties.firstName}!`);
});
} catch (err) {
console.error("An error occurred while getting profiles");
console.error(err);
}
}