Unomi Node
1.0.1
1.0.1
  • Apache Unomi Node.js SDK
  • Contribute
  • API
    • Profile
      • Create
      • Delete
      • Get
      • Count
      • Existing Properties
      • All Properties
      • Sessions
      • Get by Single Property
      • Query
    • Rule
      • Create
      • Get
      • Get All
    • Segment
Powered by GitBook
On this page
  • Usage
  • Response
  • Real World Example

Was this helpful?

  1. API
  2. Profile

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)

PreviousSessionsNextQuery

Last updated 5 years ago

Was this helpful?