Get by Single Property

Get all the profile by a single property

Usage

unomi.profile.getBySingleProperty({
  query: <string>,
  limit?: <number>,
  offset?: <number>,
  forceRefresh: <boolean>
});

Response

{
  success: <boolean>,
  status: <number>,
  data: {
    list: <object[]>,
    offset: <number>,
    pageSize: <number>,
    totalSize: <number>
  }
}

Real World Example

async function logUserNames() {

  const users = await unomi.profile.getBySingleProperty({
    query: "name = \"John\"",
    limit:  5, // Default limit is 100
    offset: 5, // Default offset is 0
    forceRefresh: true // Default is false
  });
  
  users.data.list.forEach((user) => console.log(user.firstName));
}

Valid comparison operators are: =, <, > (equal, greater than, less than)

Last updated